libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HEAD: static tests


From: Ralf Wildenhues
Subject: Re: HEAD: static tests
Date: Tue, 21 Feb 2006 10:16:57 +0100
User-agent: Mutt/1.5.11

* Ralf Wildenhues wrote on Mon, Jan 30, 2006 at 10:29:33PM CET:
> * Ralf Wildenhues wrote on Mon, Jan 30, 2006 at 02:01:53PM CET:
> > 
> > I will followup to this mail (to libtool-patches only for size) with a
> > patch to implement per-deplib flags for programs (for CVS HEAD) and add
> > comprehensive tests for the static flags.
> 
> Here goes the test.  Note that the tests uncovered that hardcoding
> was not done in all cases where necessary with the `-static' flag
> since we changed its behavior; a fix will be proposed in a followup.

Small update to the proposed patch: if link_static_flag is empty, don't
expect `-all-static' to do wonders magically.  Add keyword, remove some
cruft leftover from testing.

I intend to apply as one patch.  If ok..

Cheers,
Ralf

>       * tests/static.at: New tests for comprehensive test exposure of
>       all current and proposed static linking flags for programs.
>       * Makefile.am, tests/testsuite.at: Updated.


--- tests/static.at     2006-02-21 08:29:17.000000000 +0100
+++ tests/static.at     2006-02-03 10:14:52.000000000 +0100
@@ -63,6 +63,7 @@
 #   (most likely the Sun compiler suite will be the only problem child).
 
 AT_SETUP([static linking flags for programs])
+AT_KEYWORDS([libtool])
 
 LDFLAGS="$LDFLAGS -no-undefined"
 prefix=`pwd`/inst
@@ -207,7 +227,7 @@
   # global static flags.
   for st in -static -static-libtool-libs -all-static; do
     AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS $st -o m$st m.$OBJEXT \
-             -L${libdir}1 $R -la1 a2/liba2.la -L${libdir}3 -R${libdir}3 -la3],
+             -L${libdir}1 -la1 a2/liba2.la -L${libdir}3 -R${libdir}3 -la3],
             [0], [ignore], [ignore])
   done
 
@@ -270,21 +292,26 @@
   # - remove the library images to catch failure to link 
statically/dynamically,
   # - add false other deplibs in the paths to catch (some) wrongly added run 
paths.
 
+  # if -all-static does not work, do not exercise it any more.
+  all_static=-all-static
+  eval `$LIBTOOL --config | grep '^link_static_flag='`
+  test -z "$link_static_flag" && all_static=
+
   echo "### test whether installed libtool library liba2 was linked statically"
   func_move_libs a2 ${libdir}2
-  func_test_exec -static -static-libtool-libs -all-static `$per_deplib && echo 
2 12 23 123 123a`
+  func_test_exec -static -static-libtool-libs $all_static `$per_deplib && echo 
2 12 23 123 123a`
   $per_deplib && func_test_exec_fail 1 3 13 31
   func_restore_libs a2 ${libdir}2
 
   echo "### test whether uninstalled libtool library liba1 was linked 
statically"
   func_move_libs a1 ${libdir}1
-  func_test_exec -static-libtool-libs -all-static `$per_deplib && echo 1 12 13 
31 123 123a`
+  func_test_exec -static-libtool-libs $all_static `$per_deplib && echo 1 12 13 
31 123 123a`
   $per_deplib && func_test_exec_fail -static 2 3 23
   func_restore_libs a1 ${libdir}1
 
   echo "### test whether non-libtool library liba3 was linked statically"
   func_move_libs a3 ${libdir}3
-  func_test_exec -all-static `$per_deplib && echo 3 13 23 31 123 123a`
+  func_test_exec $all_static `$per_deplib && echo 3 13 23 31 123 123a`
   func_test_exec_fail -static -static-libtool-libs `$per_deplib && echo 1 2 12`
   func_restore_libs a3 ${libdir}3
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]