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

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

 



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.




_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux