From: Gary V. Vaughan Date: Sun, 27 Nov 2011 12:18:23 +0000 (+0700) Subject: tests: let pic_flag and with-pic Autotests work on non-VPATH builds. X-Git-Tag: v2.4.2.418~156 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c91aa0b5c711ca63a168317a1493ed93683cac55;p=thirdparty%2Flibtool.git tests: let pic_flag and with-pic Autotests work on non-VPATH builds. * tests/pic_flag.at: Use _LT_DEMO_SETUP to generate a demo style project, rather than relying on $abs_top_srcdir/configure. * tests/with-pic.at: Likewise. * Makefile.am (TESTSUITE_AT): Move tests/pic_flag.at and tests/with-pic.at so that they run immediately following tests/demo.at. Signed-off-by: Gary V. Vaughan --- diff --git a/Makefile.am b/Makefile.am index 74db69524..180d82fca 100644 --- a/Makefile.am +++ b/Makefile.am @@ -619,6 +619,8 @@ TESTSUITE_AT = tests/testsuite.at \ tests/getopt-m4sh.at \ tests/libtoolize.at \ tests/demo.at \ + tests/pic_flag.at \ + tests/with-pic.at \ tests/cdemo.at \ tests/convenience.at \ tests/depdemo.at \ @@ -675,13 +677,11 @@ TESTSUITE_AT = tests/testsuite.at \ tests/ctor.at \ tests/exceptions.at \ tests/early-libtool.at \ - tests/with-pic.at \ tests/no-executables.at \ tests/deplibs-ident.at \ tests/configure-iface.at \ tests/stresstest.at \ tests/cmdline_wrap.at \ - tests/pic_flag.at \ tests/f77demo.at \ tests/fcdemo.at \ tests/darwin.at \ diff --git a/tests/pic_flag.at b/tests/pic_flag.at index 20beec0ff..c72593bb8 100644 --- a/tests/pic_flag.at +++ b/tests/pic_flag.at @@ -44,10 +44,17 @@ if $CXX $CPPFLAGS $CXXFLAGS $CXX_pic_flag -c foo.cpp; then :; else CXX_pic_flag= fi -AT_CHECK([test . != "$at_srcdir" || exit 77]) +# Set up a tests/demo.at style project. +_LT_DEMO_SETUP + +# Bootstrap, and configure it so that we can extract libtool --config +# settings. +LT_AT_BOOTSTRAP([], [-I m4], [], [--add-missing], [], + [ignore], [ignore]) + LT_AT_CONFIGURE([lt_cv_prog_compiler_pic="$C_pic_flag" ]dnl [lt_cv_prog_compiler_pic_CXX="$CXX_pic_flag"], - ["$abs_top_srcdir"/configure --disable-silent-rules]) + [./configure]) : ${MAKE=make} AT_CHECK([$MAKE], [], [stdout], [ignore]) AT_CHECK([if ./libtool --features | grep 'enable shared libraries'; then ]dnl diff --git a/tests/with-pic.at b/tests/with-pic.at index 915acf598..2ffbd0345 100644 --- a/tests/with-pic.at +++ b/tests/with-pic.at @@ -22,6 +22,14 @@ #### AT_SETUP([test --with-pic]) + +# Set up a tests/demo.at style project. +_LT_DEMO_SETUP + +# Bootstrap, and configure it so that we can extract libtool --config +# settings. +LT_AT_BOOTSTRAP([], [-I m4], [], [--add-missing], [], + [], [ignore]) eval `$LIBTOOL --config | $EGREP '^(pic_flag|FGREP)='` real_pic=false @@ -31,25 +39,24 @@ esac AT_CHECK([$real_pic || exit 77]) AT_CHECK([test . != "$at_srcdir" || exit 77]) -CONFIGURE=$abs_top_srcdir/tests/demo/configure : ${MAKE=make} -LT_AT_CONFIGURE([--disable-shared --with-pic=no], [$CONFIGURE]) +LT_AT_CONFIGURE([--disable-shared --with-pic=no]) AT_CHECK([$MAKE], [], [stdout], [ignore]) AT_CHECK([$FGREP -v "$pic_flag" stdout], [], [ignore], [ignore]) $MAKE clean -LT_AT_CONFIGURE([--disable-shared --with-pic=yes], [$CONFIGURE]) +LT_AT_CONFIGURE([--disable-shared --with-pic=yes]) AT_CHECK([$MAKE], [], [stdout], [ignore]) AT_CHECK([$FGREP "$pic_flag" stdout], [], [ignore], [ignore]) $MAKE clean -LT_AT_CONFIGURE([--disable-shared --with-pic="demo,foo,bar"], [$CONFIGURE]) +LT_AT_CONFIGURE([--disable-shared --with-pic="demo,foo,bar"]) AT_CHECK([$MAKE], [], [stdout], [ignore]) AT_CHECK([$FGREP "$pic_flag" stdout], [], [ignore], [ignore]) $MAKE clean -LT_AT_CONFIGURE([--disable-shared --with-pic="foo,bar"], [$CONFIGURE]) +LT_AT_CONFIGURE([--disable-shared --with-pic="foo,bar"]) AT_CHECK([$MAKE], [], [stdout], [ignore]) AT_CHECK([$FGREP -v "$pic_flag" stdout], [], [ignore], [ignore]) $MAKE clean