]> arthur.barton.de Git - bup.git/commitdiff
configure.inc: fix LDFLAGS validation
authorRob Browning <rlb@defaultvalue.org>
Sat, 9 Jul 2022 18:15:53 +0000 (13:15 -0500)
committerRob Browning <rlb@defaultvalue.org>
Mon, 11 Jul 2022 18:19:17 +0000 (13:19 -0500)
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>
config/configure.inc

index 0834263bc586c8051e51aaada8b8f7cf87796989..ed3b5c4b0bbb16437e9e75082e7f749de2d989ef 100644 (file)
@@ -492,7 +492,7 @@ EOF
 
        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
@@ -502,8 +502,9 @@ EOF
            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