if [ "$CFLAGS" ]; then
test "$CFLAGS" && echo "validating CFLAGS=${CFLAGS}"
- if $AC_CC $CFLAGS -o "$__ac_tmpdir/ngc$$.o" "$__ac_tmpdir/ngc$$.c" ; then
+ if $AC_CC $CFLAGS -o "$__ac_tmpdir/ngc$$" "$__ac_tmpdir/ngc$$.c" ; then
AC_CFLAGS=${CFLAGS:-"-g"}
test "$CFLAGS" && echo "CFLAGS=\"${CFLAGS}\" are okay"
elif [ "$CFLAGS" ]; then
AC_CFLAGS=-g
fi
if [ "$LDFLAGS" ]; then
- test "$LDFLAGS" && echo "validating LDFLAGS=${LDFLAGS}"
- if $AC_CC $LDFLAGS -o "$__ac_tmpdir/ngc$$" "$__ac_tmpdir/ngc$$.o"; then
+ echo "validating LDFLAGS=${LDFLAGS}"
+ $AC_CC $AC_CFLAGS -c -o "$__ac_tmpdir/ngc$$.o" "$__ac_tmpdir/ngc$$.c"
+ if $AC_CC $AC_CFLAGS $LDFLAGS -o "$__ac_tmpdir/ngc$$" "$__ac_tmpdir/ngc$$.o"; then
AC_LDFLAGS=${LDFLAGS:-"-g"}
test "$LDFLAGS" && TLOG "LDFLAGS=\"${LDFLAGS}\" are okay"
elif [ "$LDFLAGS" ]; then
# acLookFor actually looks for a program, without setting anything.
#
acLookFor () {
- path=${AC_PATH:-$ac_default_path}
+ path="${AC_PATH:-$ac_default_path}"
case "X$1" in
X-[rx]) __mode=$1
shift
for program in $*; do
IFS=":"
for x in $path; do
- if [ $__mode $x/$program -a -f $x/$program ]; then
- echo $x/$program
+ if [ $__mode "$x/$program" -a -f "$x/$program" ]; then
+ echo "$x/$program"
break 2
fi
done
AC_MAK $SYM
AC_DEFINE PATH_$__sym \""$DEST"\"
AC_SUB $__sym "$DEST"
- eval CF_$SYM=$DEST
+ eval CF_$SYM="'$DEST'"
return 0
else
#AC_SUB $__sym ''
# and fd 5 points to what used to be fd 1
#
AC_INIT () {
- __ac_tmpdir=$(mktemp -d)
+ __ac_tmpdir=$(mktemp -d configure-XXXXXX)
__config_files="config.cmd config.sub config.h config.mak config.log"
__config_detritus="config.h.tmp"
rm -f $__config_files $__config_detritus
if [ "$DEST" ]; then
rm -f "$__ac_tmpdir/b$$"
- $DEST -s "$__ac_tmpdir/a$$" "$__ac_tmpdir/b$$"
+ "$DEST" -s "$__ac_tmpdir/a$$" "$__ac_tmpdir/b$$"
if [ "`$AC_FIND_PROG $__ac_tmpdir/b$$ -type l -print`" ]; then
TLOG " ($DEST)"
echo "$DEST exists, and ln -s works"
if test -z "$AC_FIND_PROG"; then
MF_PATH_INCLUDE FIND find
rc=$?
- AC_FIND_PROG=$DEST
+ AC_FIND_PROG="$DEST"
return $rc
fi
return 0
if test -z "$AC_AWK_PROG"; then
MF_PATH_INCLUDE AWK awk
rc=$?
- AC_AWK_PROG=$DEST
+ AC_AWK_PROG="$DEST"
return $rc
fi
return 0
if test -z "$AC_SED_PROG"; then
MF_PATH_INCLUDE SED sed
rc=$?
- AC_SED_PROG=$DEST
+ AC_SED_PROG="$DEST"
return $rc
fi
return 0
AC_SUB 'GENERATED_FILES' "$*"
AC_SUB 'CFLAGS' "$AC_CFLAGS"
AC_SUB 'FCFLAGS' "$AC_FCFLAGS"
+ AC_SUB 'CPPFLAGS' "$AC_CPPFLAGS"
AC_SUB 'CXXFLAGS' "$AC_CXXFLAGS"
AC_SUB 'LDFLAGS' "$AC_LDFLAGS"
AC_SUB 'srcdir' "$AC_SRCDIR"
Q=\'
cat - > config.cmd << EOF
#! /bin/sh
-${CXX:+CXX=${Q}${CXX}${Q}} ${CXXFLAGS:+CXXFLAGS=${Q}${CXXFLAGS}${Q}} ${FC:+FC=${Q}${FC}${Q}} ${FCFLAGS:+FCFLAGS=${Q}${FCFLAGS}${Q}} ${CC:+CC=${Q}${CC}${Q}} ${CFLAGS:+CFLAGS=${Q}${CFLAGS}${Q}} $ac_progname $ac_configure_command
+${CXX:+CXX=${Q}${CXX}${Q}} ${CPPFLAGS:+CPPFLAGS=${Q}${CPPFLAGS}${Q}} ${CXXFLAGS:+CXXFLAGS=${Q}${CXXFLAGS}${Q}} ${FC:+FC=${Q}${FC}${Q}} ${FCFLAGS:+FCFLAGS=${Q}${FCFLAGS}${Q}} ${CC:+CC=${Q}${CC}${Q}} ${CFLAGS:+CFLAGS=${Q}${CFLAGS}${Q}} $ac_progname $ac_configure_command
EOF
chmod +x config.cmd
# BSD install or GNU install? Let's find out...
touch "$__ac_tmpdir/a$$"
- $DEST "$__ac_tmpdir/a$$" "$__ac_tmpdir/b$$"
+ "$DEST" "$__ac_tmpdir/a$$" "$__ac_tmpdir/b$$"
if test -r "$__ac_tmpdir/a$$"; then
LOG " ($DEST)"
#
AC_PROG_CPP () {
if [ "$AC_CPP_PROG" ]; then
- DEST=$AC_CPP_PROG
+ DEST="$AC_CPP_PROG"
else
__ac_path="$AC_PATH"
AC_PATH="/lib:/usr/lib:${__ac_path:-$ac_default_path}"
LOGN "Looking for cpp"
if [ "$DEST" ]; then
TLOGN " ($DEST)"
- acCheckCPP $DEST "$CPPFLAGS" || \
- acCheckCPP $DEST -traditional-cpp -E || \
- acCheckCPP $DEST -E || \
- acCheckCPP $DEST -traditional-cpp -pipe || \
- acCheckCPP $DEST -pipe || fail=1
+ acCheckCPP "$DEST" "$CPPFLAGS" || \
+ acCheckCPP "$DEST" -traditional-cpp -E || \
+ acCheckCPP "$DEST" -E || \
+ acCheckCPP "$DEST" -traditional-cpp -pipe || \
+ acCheckCPP "$DEST" -pipe || fail=1
if [ "$fail" ]; then
AC_FAIL " (can't run cpp as a pipeline)"