autoconf
[Top][All Lists]
Advanced

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

Re: $abs_srcdir expansion


From: Stefano Sabatini
Subject: Re: $abs_srcdir expansion
Date: Fri, 9 Jul 2010 10:38:50 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On date Thursday 2010-07-08 18:41:48 +0200, Peter Breitenlohner wrote:
> On Thu, 8 Jul 2010, Stefano Sabatini wrote:
> 
> >No, this will not work, because I need LDFLAGS to be defined during
> >configuration, ...
> 
> in that case you'll have to save CFLAGS, LDFLAGS, etc. and temporarily add
> values based on $srcdir to be used during configure tests, and later restore
> these flags and add values based on ${abs_srcdir} (unexpanded) to be used in
> Makefile.

Mmh do you mean something like this:

SAVED_CFLAGS="$CFLAGS"
CFLAGS="... -I${srcdir}/foo/bar ... $CFLAGS"
# now use the $CFLAGS as defined above during configuration
...

# redefine $CFLAGS before to create the output files 
CFLAGS="... -I\${srcdir}/foo/bar ... $SAVED_CFLAGS"
...

That looks very brittle.

> I would, however, use other means to define these flags for Makefile, e.g.,
> specify
>    if <whatever>; then
>       xxxFLAGS='-I${abs_srcdir}/win32/pthread'
>    fi
>    AC_SUBST([xxxFLAGS])
>
> in configure and use that variable in Makefile.

Sorry but cannot understand what's the point of this, I need to use
the CFLAGS, LDFLAGS, etc during configuration. In the configure the
paths used may be relative, since all the commands are executed from
the current dir, in the makefile they *need* to be absolute, *or* need
to use a parametric path defined using the makefile expanded variables
${srcdir} etc, or I'll have a libtool command failing since those
flags are used from many different paths.

My problem is not to define a valid path in the Makefile, I already
know how to do that, my problem is defining in a consistent way some
flags which may be used both at configure time and at build time.

> BTW: required flags as determined by configure should not go to CFLAGS,
> because the user is entitled to use 'make CFLAGS=some_flags some_target'.
> Using Automake they would typically go to AM_CFLAGS.

Thanks, regards.



reply via email to

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