Change the CFLAGS validation to create ngc$$ instead of ngc$$.o since
it doesn't specify -c.
Change the LDFLAGS validation to create the .o file it needs.
Previously it relied on the CFLAGS test, which was optional, to do
that, and the CFLAGS test was actually creating an executable, not an
object file.
Thanks to Greg Troxel for reporting the omission.
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
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