]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Fix several test failures on Cygwin and MinGW.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 8 Mar 2008 18:02:39 +0000 (18:02 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 8 Mar 2008 18:02:39 +0000 (18:02 +0000)
* tests/nonrecursive.at: Use -no-undefined for foo.la.
* tests/recursive.at: Likewise.
* tests/subproject.at: Likewise.
* tests/lt_dladvise.at: For systems where undefined symbols are
not allowed, to not try to load the module libdepend.
[ mingw ]: Add to list of such systems.
* tests/testsuite.at (_LT_AT_TRANSLATE_TEXT_OUTPUT): New macro,
to translate line ending of expout and experr files suitable for
host executables.
(LT_AT_CHECK, LT_AT_NOINST_EXEC_CHECK): Use it.
Report by Bob Friesenhahn.

ChangeLog
tests/lt_dladvise.at
tests/nonrecursive.at
tests/recursive.at
tests/subproject.at
tests/testsuite.at

index 3d3555ff3e11f7ec2f0f9c7e37495a37e7f3fd5c..f3196220db78dad7596b9df5ad8a029ffe842407 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2008-03-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       Fix several test failures on Cygwin and MinGW.
+       * tests/nonrecursive.at: Use -no-undefined for foo.la.
+       * tests/recursive.at: Likewise.
+       * tests/subproject.at: Likewise.
+       * tests/lt_dladvise.at: For systems where undefined symbols are
+       not allowed, to not try to load the module libdepend.
+       [ mingw ]: Add to list of such systems.
+       * tests/testsuite.at (_LT_AT_TRANSLATE_TEXT_OUTPUT): New macro,
+       to translate line ending of expout and experr files suitable for
+       host executables.
+       (LT_AT_CHECK, LT_AT_NOINST_EXEC_CHECK): Use it.
+       Report by Bob Friesenhahn.
+
        Fix installcheck dependencies, fix for --program-transform-name.
        * Makefile.am (installcheck-local): Depend upon tests/atconfig
        and $(srcdir)/$(TESTSUITE).
index 6c41a29763543296a9a2a98df3264d582f7dcbb2..617539f85076e94efa5325bb98d794a4ab54c0fb 100644 (file)
@@ -173,8 +173,9 @@ hint_global (void)
       printf ("global: %d\n", moduletest (handle, "f", "i"));
 
       /* Don't attempt to load moddepend unless modglobal was successfully
-         loaded and the symglobal hint was taken.  */
-      if (info && info->is_symglobal)
+         loaded and the symglobal hint was taken, and the system allows to
+        to have undefined symbols.  */
+      if (info && info->is_symglobal && HAVE_UNDEFINED_SYMBOLS)
         {
           hint_ext ();
         }
@@ -285,10 +286,12 @@ dlopenable='resident local global'
 # ------------------------------------------------------------------------- #
 
 case $host_os in
-cygwin*)
+cygwin* | mingw*)
   # These hosts do not support linking without -no-undefined
+  CPPFLAGS="$CPPFLAGS -DHAVE_UNDEFINED_SYMBOLS=0"
   ;;
 *)
+  CPPFLAGS="$CPPFLAGS -DHAVE_UNDEFINED_SYMBOLS=1"
   dlopenable="$dlopen depend"
   $LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c moddepend.c
   AT_CHECK([$LIBTOOL --mode=link $CC -module $CFLAGS $LDFLAGS -o libdepend.la \
@@ -317,8 +320,8 @@ for dlopen in -dlopen; do
     modules="${modules+$modules }$dlopen lib$module.la"
   done
 
-  AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o main main.$OBJEXT \
-           $modules $LIBLTDL], [], [ignore], [ignore])
+  AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o main main.$OBJEXT $modules $LIBLTDL],
+          [], [ignore], [ignore])
   LT_AT_NOINST_EXEC_CHECK([./main], [$modules], [], [expout], [])
 done
 
index 5f84cb083ff47ebe7d723660d6ed121eef3a8c9c..0ccabe89f8aefa667c6855f3ee06428b50e60e24 100644 (file)
@@ -64,7 +64,7 @@ MOSTLYCLEANFILES      =
 
 include ltdl/Makefile.inc
 
-foo_la_LDFLAGS         = -module -avoid-version
+foo_la_LDFLAGS         = -module -avoid-version -no-undefined
 foo_la_SOURCES         = foo.c
 ]])
 
index 3a120f0add51a03f0cba67ba46d9a7be90c2b796..f27939867988b407c9baa6888f2db1a7368ece6c 100644 (file)
@@ -46,7 +46,7 @@ AT_DATA([Makefile.am],
 AUTOMAKE_OPTIONS = 1.7
 SUBDIRS = ltdl
 lib_LTLIBRARIES = foo.la
-foo_la_LDFLAGS = -module -avoid-version
+foo_la_LDFLAGS = -module -avoid-version -no-undefined
 foo_la_SOURCES = foo.c
 ]])
 
index 0477fa7d6468959b1fff181c5fe50a93ed539c16..4b32f44f97841573a510e29fe387f32948f10446 100644 (file)
@@ -1,6 +1,6 @@
 # subproject.at -- test subproject Libltdl builds             -*- Autotest -*-
 #
-#   Copyright (C) 2005 Free Software Foundation, Inc.
+#   Copyright (C) 2005, 2008 Free Software Foundation, Inc.
 #   Written by Gary V. Vaughan, 2005
 #
 #   This file is part of GNU Libtool.
@@ -44,7 +44,7 @@ AT_DATA([Makefile.am],
 AUTOMAKE_OPTIONS = 1.9
 SUBDIRS = sub/ltdl
 lib_LTLIBRARIES = foo.la
-foo_la_LDFLAGS = -module -avoid-version
+foo_la_LDFLAGS = -module -avoid-version -no-undefined
 ]])
 
 echo 'int dummy = 0;' > foo.c
index d2f89dd523d978b0904611b7adfc536185fe83a2..3bd5f632a7fda3eb5028c3a4fc4491ffe9312723 100644 (file)
@@ -173,10 +173,23 @@ m4_define([LT_ESCAPE],
 m4_define([LT_AT_CHECK],
 [echo "LT_ESCAPE([$1])"; AT_CHECK($@)])
 
+
+# _LT_AT_TRANSLATE_TEXT_OUTPUT(FILE)
+# ----------------------------------
+# Ensure correct line ending for expected output of host executables.
+m4_define([_LT_AT_TRANSLATE_TEXT_OUTPUT],
+[case $host_os in mingw*)
+  while read -r l; do printf "%s\r\n" "$l"; done < $1 > $1.t
+  mv -f $1.t $1 ;;
+esac])
+
+
 # LT_AT_EXEC_CHECK(EXECUTABLE, [STATUS = 0], [STDOUT], [STDERR])
 # --------------------------------------------------------------
 m4_define([LT_AT_EXEC_CHECK],
-[AT_CHECK([$1; lt_status=$?; if test $lt_status -eq 0; then :;
+[m4_if([$3], [expout], [_LT_AT_TRANSLATE_TEXT_OUTPUT([$3])])
+m4_if([$4], [experr], [_LT_AT_TRANSLATE_TEXT_OUTPUT([$4])])
+AT_CHECK([$1; lt_status=$?; if test $lt_status -eq 0; then :;
           elif test "X$host" != "X$build" && \
                { test -x "$1" || test -x "$1"$EXEEXT; }
           then (exit 77); else (exit $lt_status); fi],[$2],[$3],[$4])
@@ -187,7 +200,9 @@ m4_define([LT_AT_EXEC_CHECK],
 #                        [STATUS = 0], [STDOUT], [STDERR])
 # ---------------------------------------------------------
 m4_define([LT_AT_NOINST_EXEC_CHECK],
-[AT_CHECK([$LIBTOOL --mode=execute $2 $1; lt_status=$?;
+[m4_if([$4], [expout], [_LT_AT_TRANSLATE_TEXT_OUTPUT([$4])])
+m4_if([$5], [experr], [_LT_AT_TRANSLATE_TEXT_OUTPUT([$5])])
+AT_CHECK([$LIBTOOL --mode=execute $2 $1; lt_status=$?;
           if test $lt_status -eq 0; then :;
           elif test "X$host" != "X$build" && \
                { test -x "$1" || test -x "$1"$EXEEXT; }