>>> "John" == John D Burger <[EMAIL PROTECTED]> writes:
[...] John> Here's what I've come up with: John> eval test -d $includedir && CPPFLAGS="-I$includedir $CPPFLAGS" John> eval jb_expanded_libdir=$libdir John> jb_expanded_libdir=`echo $jb_expanded_libdir | sed "s%^NONE%$prefix%"` John> eval test -d $jb_expanded_libdir && LDFLAGS="-L$libdir $LDFLAGS" John> I decided not to simply replace NONE with the appropriate values, as in John> the code I pointed to earlier: John> http://sources.redhat.com/ml/autoconf-patches/2000-07/msg00133.html John> I'm leaving NONE in for prefix in order to implicitly deal with the John> issue described in the GCC manual. That won't do it: NONE/include stands for /usr/local/include while you want to protect against -I/usr/include. John> I realize that if the user has a NONE/include or NONE/lib John> subdirectory, I will be screwed, but barring that, John> nothing will be added to the CPPFLAGS unless the user John> configures with -includedir or -prefix, and similarly for John> LDFLAGS. I guess I really should check for NONE John> explicitly ... John> The expanded_libdir business is because I =do= want to change NONE to John> $prefix in the case of exec_prefix. $prefix might also be NONE at this stage. That means the default prefix /usr/local will be used, and if I understand you correctly you want to add -I /usr/local/include and -L /usr/local/lib in this case. The following suggestion is completly untested: dnl jb_PREFIX_EXPAND(VARNAME) dnl ------------------------- dnl Expand $prefix and $exec_prefix in $VARNAME and assign the dnl result to jb_expanded_VARNAME. dnl (Adapted from AC_DEFINE_DIR by Alexandre Oliva) AC_DEFUN([jb_PREFIX_EXPAND],[ jb_expanded_$1=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""[$]$1"\" )`]) jb_PREFIX_EXPAND([includedir]) jb_PREFIX_EXPAND([libdir]) test "$jb_expanded_includedir" != /usr/include && test -d $jb_expanded_includedir && CPPFLAGS="-I$includedir $CPPFLAGS" test -d $jb_expanded_libdir && LDFLAGS="-L$libdir $LDFLAGS" -- Alexandre Duret-Lutz
