From 0805518173d95032e22c2832e73724c08ac2d9c7 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Sun, 6 Sep 2009 12:42:34 +0200 Subject: [PATCH] Fix failure test in the presence of --with-pic or -prefer-pic. * tests/fail.at (Failure tests): Run non-PIC failure test only if pic_mode is 'default' or 'no', rather than 'default' or 'yes' and also -prefer-pic has not been passed in $CFLAGS. * THANKS: Update. Report by Donn Washburn. Signed-off-by: Ralf Wildenhues --- ChangeLog | 7 +++++++ THANKS | 1 + tests/fail.at | 15 ++++++++++----- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 599d33e06..60bf37375 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2009-09-06 Ralf Wildenhues + Fix failure test in the presence of --with-pic or -prefer-pic. + * tests/fail.at (Failure tests): Run non-PIC failure test only + if pic_mode is 'default' or 'no', rather than 'default' or 'yes' + and also -prefer-pic has not been passed in $CFLAGS. + * THANKS: Update. + Report by Donn Washburn. + Add testsuite exposure for passing of compiler and linker flags. * tests/flags.at (passing flags through libtool): New file, new test, for bug fixed in previous commit. diff --git a/THANKS b/THANKS index e976ba876..935388598 100644 --- a/THANKS +++ b/THANKS @@ -88,6 +88,7 @@ Daniel Reed n@ml.org Daniel Richard G. skunk@iSKUNK.ORG DJ Delorie dj@delorie.com + Donn Washburn n5xwb@comcast.net Edouard G. Parmelan Edouard.Parmelan@France.NCR.COM Erez Zadok ezk@shekel.mcl.cs.columbia.edu Eric Estievenart eric@via.ecp.fr diff --git a/tests/fail.at b/tests/fail.at index fb05f8cfc..cec954b3d 100644 --- a/tests/fail.at +++ b/tests/fail.at @@ -50,15 +50,20 @@ FAIL_CHECK([$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c a.c]) AT_CHECK([test -f a.lo], [1]) # non-PIC compile failure -case $pic_mode in default | yes) - case $build_old_libs,$pic_flag in yes,*-DPIC*) - AT_DATA([a.c], [[ +case $pic_mode in default | no) + case " $CFLAGS " in + *\ -prefer-pic\ *) ;; + *) + case $build_old_libs,$pic_flag in yes,*-DPIC*) + AT_DATA([a.c], [[ #ifndef PIC choke me #endif ]]) - FAIL_CHECK([$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -no-suppress -c a.c]) - AT_CHECK([test -f a.lo], [1]) + FAIL_CHECK([$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -no-suppress -c a.c]) + AT_CHECK([test -f a.lo], [1]) + ;; + esac ;; esac ;; -- 2.47.2