autoconf
[Top][All Lists]
Advanced

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

AC_RUN_IFELSE vrs --prefix and --exec-prefix -they fight with each other


From: Duane Ellis
Subject: AC_RUN_IFELSE vrs --prefix and --exec-prefix -they fight with each other.
Date: Thu, 25 Dec 2008 21:38:03 -0500
User-agent: Thunderbird 2.0.0.18 (Windows/20081105)

In a ./configure script I am working on

I make use of the idiom: AC_RUN_IFELSE( [ some code ], [ success ], [ failure ] )

The problem is, the CFLAGS and LDFLAGS at that point contain:
       CFLAGS="-I$includedir"
And  LDFLAGS="-L$libdir -Wl,-rpath,$libdir"

Which - is correct

however, when the AC_RUN_IFELSE compiles and links the [some code], the variables $includedir and$libdir are expanded before hand. Literally, the compiler (gcc in this case) sees -I$includedir, rather then -I/the/expanded/text, likewise for LDFLAGS

As I understand - this is caused by the "gnu coding standards" - as it applies to *MAKEFILES*, so that somebody can do this: 'make include_dir=/foo/bar' if they want to.

However, in this case, I'm still inside "configure" and need to evaluate this. My only solution right now is to do something like this (LDFLAGS not shown)

CFLAGS_SAVE=$CFLAGS
_CFLAGS=`eval echo $CFLAGS`
AC_RUN_IFELSE(  [ some code ], [ success ], [ failure ] )
CFLAGS=$CFLAGS_SAVE

Is there a better way to do this?

-Duane.






reply via email to

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