autoconf
[Top][All Lists]
Advanced

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

Re: AC_PROG_CC with absolute path


From: Matthew Woehlke
Subject: Re: AC_PROG_CC with absolute path
Date: Tue, 03 Apr 2007 11:49:30 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.4.0

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 configure.ac)
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.)

--
Matthew
Obscurity: +5





reply via email to

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