[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_PROG_CC with absolute path

From: Harald Servat
Subject: Re: AC_PROG_CC with absolute path
Date: Wed, 04 Apr 2007 08:27:32 +0200
User-agent: Thunderbird (X11/20061027)

Hash: SHA1

Matthew Woehlke wrote:
> Harald Servat wrote:
>> Matthew Woehlke wrote:
>>> Harald Servat wrote:
>>>>   I'm trying to provide a compiler to this macro (using it's name and
>>>> the full path name) when some special conditions occur but as it isn't
>>>> on the default $PATH, AC_PROG_CC skips it.
>>>>   Right now, I can only find two solutions. Just add the the directory
>>>> that contains this compiler to the $PATH or set CC (in the
>>>> with this compiler when those conditions happen.
>>>>   First approach isn't quite user-friendly because each time I want to
>>>> run configure I have to touch the PATH variable. The latter would
>>>> skip a
>>>> new compiler given by the user through CC environment variable when
>>>> invoking configure.
>>> I'm not clear what's wrong with option 1. Can't you set PATH in the
>>> configure script? I would guess you can check these "conditions" and
>>> only tinker with it when they occur, even. Why is this "unfriendly"?
>> Yes, I can set it.
>> But that's my "problem":
>> If I set it at my .bashrc (for example) when I share this package other
>> users must put this directory in their PATH too, and I want to avoid
>> this if possible because I want this procedure as automatic and
>> transparent as possible.
>> If I set PATH on the configure script, Makefile will not find it by
>> default because this new value for PATH isn't seen by the Makefile.
>> So, in this situation, I'm unable to give an automatic compiler
>> selection without asking the user to alter it's PATH.
>> Of course, I can do it. It's feasible. But I'm looking for a solution
>> that does not require the user to alter his PATH.
> Hmm, ok, I was thinking that configure would set
> CC=/full/path/to/my/compiler in this case. (Maybe that would work? Or
> maybe not, I guess 'compiler' might need other things in its directory,
> so you still need to set PATH.)
> Hmm, but wait, you could set CC='PATH=<stuff to mangle PATH
> /full/path/to/my/compiler' so that when Make invokes the compiler, it
> gets an altered PATH. Would that work? (Or write a wrapper script; this
> solves the invoke-with-mangled-PATH problems but you still must set CC
> to a full path to the wrapper script.)

Good morning,

Maybe another solution could be set CC directly when these "conditions"
appear inside configure only if the user does not set it explicitly.

I'll try them both and I'll choose the most "clear solution".

Thanks for your feedback!

Version: GnuPG v1.4.5 (FreeBSD)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]