From: Ralf Wildenhues Date: Sat, 8 Mar 2008 18:02:39 +0000 (+0000) Subject: Fix several test failures on Cygwin and MinGW. X-Git-Tag: v2.2.2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b8b9e3e5eb98322267b03487f73f427bb0fe2ab;p=thirdparty%2Flibtool.git 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. --- diff --git a/ChangeLog b/ChangeLog index 3d3555ff3..f3196220d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ 2008-03-08 Ralf Wildenhues + 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). diff --git a/tests/lt_dladvise.at b/tests/lt_dladvise.at index 6c41a2976..617539f85 100644 --- a/tests/lt_dladvise.at +++ b/tests/lt_dladvise.at @@ -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 diff --git a/tests/nonrecursive.at b/tests/nonrecursive.at index 5f84cb083..0ccabe89f 100644 --- a/tests/nonrecursive.at +++ b/tests/nonrecursive.at @@ -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 ]]) diff --git a/tests/recursive.at b/tests/recursive.at index 3a120f0ad..f27939867 100644 --- a/tests/recursive.at +++ b/tests/recursive.at @@ -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 ]]) diff --git a/tests/subproject.at b/tests/subproject.at index 0477fa7d6..4b32f44f9 100644 --- a/tests/subproject.at +++ b/tests/subproject.at @@ -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 diff --git a/tests/testsuite.at b/tests/testsuite.at index d2f89dd52..3bd5f632a 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -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; }