]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* tests/lt_dladvise.at: Use the lib prefix throughout for
authorGary V. Vaughan <gary@gnu.org>
Tue, 22 May 2007 12:07:06 +0000 (12:07 +0000)
committerGary V. Vaughan <gary@gnu.org>
Tue, 22 May 2007 12:07:06 +0000 (12:07 +0000)
better portability - testing whether modules build and load
without that prefix is not the domain of this test.
Also, only run the test of the global hint with the depend
module on hosts that can compile a module without passing
-no-undefined in link mode.

ChangeLog
tests/lt_dladvise.at

index 1ed15040f713c7ab12ac111cffe8a3a75ce11422..96e7b70209c203a5333432e500a46ef04b76e034 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-05-22  Gary V. Vaughan  <gary@gnu.org>
+
+       * tests/lt_dladvise.at:  Use the lib prefix throughout for
+       better portability - testing whether modules build and load
+       without that prefix is not the domain of this test.
+       Also, only run the test of the global hint with the depend
+       module on hosts that can compile a module without passing
+       -no-undefined in link mode.
+
 2007-05-10  Noah Misch  <noah@cs.caltech.edu>
 
        * tests/duplicate_deps.at: Make the XFAIL unconditional, but
index 7ee612730cfc98a22114fd8a2d69618d78c841e1..5945c74085c2d9094ee9237c6548388db7afa74b 100644 (file)
@@ -93,7 +93,7 @@ hint_ext (void)
   if (lt_dladvise_init (&advise) || lt_dladvise_ext (&advise))
     complain ("error setting advise ext");
 
-  handle = moduleopen ("moddepend", advise);
+  handle = moduleopen ("libdepend", advise);
 
   if (handle)
     printf ("depend: %d\n", moduletest (handle, "g", "j"));
@@ -111,7 +111,7 @@ hint_resident (void)
   if (lt_dladvise_init (&advise) || lt_dladvise_resident (&advise))
     complain ("error setting advise resident");
 
-  handle = moduleopen ("modresident.la", advise);
+  handle = moduleopen ("libresident.la", advise);
 
   if (handle)
     {
@@ -139,7 +139,7 @@ hint_local (void)
   if (lt_dladvise_init (&advise) || lt_dladvise_local (&advise))
     complain ("error setting advise local");
 
-  handle = moduleopen ("modlocal.la", advise);
+  handle = moduleopen ("liblocal.la", advise);
 
   if (handle)
     {
@@ -165,7 +165,7 @@ hint_global (void)
   if (lt_dladvise_init (&advise) || lt_dladvise_global (&advise))
     complain ("error setting advise global");
 
-  handle = moduleopen ("modglobal.la", advise);
+  handle = moduleopen ("libglobal.la", advise);
 
   if (handle)
     {
@@ -268,25 +268,52 @@ depend: 5
 : ${LIBLTDL="$abs_builddir/../libltdl/libltdlc.la"}
 
 CPPFLAGS="$CPPFLAGS $LTDLINCL"
-LDFLAGS="$LDFLAGS"
+
+dlopenable='resident local global'
+
+# ------------------------------------------------------------------------- #
+# The depend test makes no sense unless compiled without -no-undefined. By  #
+# not building the depend module in that case, when this test passes we can #
+# be sure that hint_global() above, is being correctly informed those hosts #
+# are reporting not able to accept the global hint to lt_dlopenadvise().    #
+# ------------------------------------------------------------------------- #
+
+case $host_os in
+cygwin*)
+  # These hosts do not support linking without -no-undefined
+  ;;
+*)
+  dlopenable="$dlopen depend"
+  $LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c moddepend.c
+  AT_CHECK([$LIBTOOL --mode=link $CC -module $CFLAGS $LDFLAGS -o libdepend.la \
+            moddepend.lo -rpath /foo -avoid-version], [], [ignore], [ignore])
+  ;;
+esac
+
+# ------------------------------------------------------------------------- #
+# Other modules can be tested correctly even when built with -no-undefined. #
+# ------------------------------------------------------------------------- #
+
+LDFLAGS="$LDFLAGS -no-undefined"
 
 $CC $CPPFLAGS $CFLAGS -c main.c
-for file in modresident modlocal modglobal moddepend; do
-  $LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c $file.c
-  AT_CHECK([$LIBTOOL --mode=link $CC -module $CFLAGS $LDFLAGS -o $file.la \
-            $file.lo -rpath /foo -avoid-version], [], [ignore], [ignore])
+for name in resident local global; do
+  $LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c mod$name.c
+  AT_CHECK([$LIBTOOL --mode=link $CC -module $CFLAGS $LDFLAGS -o lib$name.la \
+            mod$name.lo -rpath /foo -avoid-version], [], [ignore], [ignore])
 done
 
 # TODO: test -dlpreopen
 for dlopen in -dlopen; do
+
+  modules=
+  for module in $dlopenable; do
+    modules="${modules+$modules }$dlopen lib$module.la"
+  done
+
   AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o main main.$OBJEXT \
-           $dlopen modresident.la $dlopen modlocal.la $dlopen modglobal.la \
-           $dlopen moddepend.la $LIBLTDL],
-           [], [ignore], [ignore])
-  LT_AT_NOINST_EXEC_CHECK([./main],
-          [$dlopen modresident.la $dlopen modlocal.la $dlopen modglobal.la \
-            $dlopen moddepend.la],
-          [], [expout], [])
+           $modules $LIBLTDL], [], [ignore], [ignore])
+  LT_AT_NOINST_EXEC_CHECK([./main], [$modules], [], [expout], [])
 done
 
 AT_CLEANUP