From: Ralf Wildenhues Date: Sat, 24 Feb 2007 08:46:19 +0000 (+0000) Subject: * doc/notes.texi: Mention MACOSX_DEPLOYMENT_TARGET issue. X-Git-Tag: release-2-1b~177 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=40c41e79e63a2609f36c9169f54c717c2a5ec8f9;p=thirdparty%2Flibtool.git * doc/notes.texi: Mention MACOSX_DEPLOYMENT_TARGET issue. * tests/template.at: Only skip those tests failing on Darwin if `-flat_namespace' is used by libtool. In that case, SKIP at the end. Analysis by Peter O'Gorman. --- diff --git a/ChangeLog b/ChangeLog index 3dcbed02b..b10202205 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-02-24 Ralf Wildenhues + + * doc/notes.texi: Mention MACOSX_DEPLOYMENT_TARGET issue. + * tests/template.at: Only skip those tests failing on Darwin + if `-flat_namespace' is used by libtool. In that case, SKIP + at the end. Analysis by Peter O'Gorman. + 2007-02-23 Ralf Wildenhues Fix -export-symbols and -export-symbols-regex for links that @@ -8,6 +15,7 @@ linker script nor a linker input file if no objects are passed. Apply export_symbols_regex in case the command line length is exceeded. + Report by Bob Friesenhahn. * libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS) : New tag variable. Default to `no'. diff --git a/doc/notes.texi b/doc/notes.texi index 2090b90d0..ec2058261 100644 --- a/doc/notes.texi +++ b/doc/notes.texi @@ -10,6 +10,12 @@ For C++ code with templates, it may be necessary to specify the way the compiler will generate the instantiations. For Portland pgCC version5, use @code{CXX='pgCC --one_instantiation_per_object'} and avoid parallel @command{make}. +@item +On Darwin, for C++ code with templates you need two level shared libraries. +Libtool builds these by default if @env{MACOSX_DEPLOYMENT_TARGET} is set to +10.3 or later at @command{configure} time. See @url{rdar://problem/4135857} +for more information on this issue. + @item FreeBSD @command{make} does not conform to @sc{posix} in its handling of file modification times, which causes it to loop while building libtool. diff --git a/tests/template.at b/tests/template.at index 25cad9168..f63589ef5 100644 --- a/tests/template.at +++ b/tests/template.at @@ -122,6 +122,16 @@ AT_CLEANUP AT_SETUP([template test with subdirs]) LT_AT_TAG([CXX]) AT_KEYWORDS([libtool]) + +# This does not work with flat namespace shared libraries on Darwin. +# Set MACOSX_DEPLOYMENT_TARGET to 10.3 or later at configure time to +# get two-level namespace shared libraries. +noskip=: +eval `$LIBTOOL --tag=CXX --config | grep '^allow_undefined_flag='` +case $allow_undefined_flag in +*-flat_namespace*) noskip=false ;; +esac + CPPFLAGS="$CPPFLAGS -I../src/lib -I../src/lib2" mkdir src obj @@ -229,15 +239,14 @@ AT_CHECK([$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS -o sub/main $ma [0], [ignore], [ignore]) LT_AT_EXEC_CHECK([./sub/main], [ignore]) # lib convenience -case $host in - *-*-darwin*) ;; - *) AT_CHECK([$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS -o lib2/libb.la lib2/b.lo -rpath /foo], - [0], [ignore], [ignore]) - AT_CHECK([$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS -o sub/main $main_o lib2/libb.la lib/liba.la], - [0], [ignore], [ignore]) - LT_AT_EXEC_CHECK([./sub/main]) - ;; -esac +if $noskip; then + AT_CHECK([$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS -o lib2/libb.la lib2/b.lo -rpath /foo], + [0], [ignore], [ignore]) + AT_CHECK([$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS -o sub/main $main_o lib2/libb.la lib/liba.la], + [0], [ignore], [ignore]) + LT_AT_EXEC_CHECK([./sub/main]) +fi + # both installed AT_CHECK([$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS -o lib/liba.la lib/a.lo -rpath /foo], [0], [ignore], [ignore]) @@ -255,28 +264,27 @@ AT_CHECK([$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS -o sub/main $ma [0], [ignore], [ignore]) LT_AT_EXEC_CHECK([./sub/main]) # lib convenience -case $host in - *-*-darwin*) ;; - *) AT_CHECK([$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS -o lib2/libb.la lib2/b.lo lib/liba.la -rpath /foo], - [0], [ignore], [ignore]) - AT_CHECK([$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS -o sub/main $main_o lib2/libb.la], - [0], [ignore], [ignore]) - LT_AT_EXEC_CHECK([./sub/main]) - ;; -esac +if $noskip; then + + AT_CHECK([$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS -o lib2/libb.la lib2/b.lo lib/liba.la -rpath /foo], + [0], [ignore], [ignore]) + AT_CHECK([$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS -o sub/main $main_o lib2/libb.la], + [0], [ignore], [ignore]) + LT_AT_EXEC_CHECK([./sub/main]) +fi # both installed -case $host in - *-*-darwin*) ;; - *) AT_CHECK([$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS -o lib2/libb.la lib2/b.lo lib/liba.la -rpath /bar], - [0], [ignore], [ignore]) - AT_CHECK([$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS -o sub/main $main_o lib2/libb.la], - [0], [ignore], [ignore]) - LT_AT_EXEC_CHECK([./sub/main]) - ;; -esac +if $noskip; then + AT_CHECK([$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS -o lib2/libb.la lib2/b.lo lib/liba.la -rpath /bar], + [0], [ignore], [ignore]) + AT_CHECK([$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS -o sub/main $main_o lib2/libb.la], + [0], [ignore], [ignore]) + LT_AT_EXEC_CHECK([./sub/main]) +fi cd .. +AT_CHECK([$noskip || (exit 77)]) + dnl with autoreconf use: dnl dnl AT_DATA(src/configure.ac,