[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: template.at on Darwin
From: |
Ralf Wildenhues |
Subject: |
Re: template.at on Darwin |
Date: |
Mon, 19 Feb 2007 10:02:38 +0100 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
* Peter O'Gorman wrote on Mon, Feb 19, 2007 at 04:49:31AM CET:
> On Feb 19, 2007, at 3:33 AM, Ralf Wildenhues wrote:
>
> >HEAD's test/template.at excludes some tests for Darwin, without any
> >sort of explanation.
> I filed this as rdar://problem/4135857 (in case any apple people are
> reading) in June 2005, it was closed as expected behavior, reopened
> after I complained and has recently been retitled as a documentation
> bug (they are going to document this behavior).
Thank you very much for the analysis and explanation. So what about
this patch?
Cheers,
Ralf
2007-02-19 Ralf Wildenhues <address@hidden>
* 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.
Index: doc/notes.texi
===================================================================
RCS file: /cvsroot/libtool/libtool/doc/notes.texi,v
retrieving revision 1.1
diff -u -r1.1 notes.texi
--- doc/notes.texi 4 Apr 2005 17:38:31 -0000 1.1
+++ doc/notes.texi 19 Feb 2007 09:01:53 -0000
@@ -11,6 +11,12 @@
@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.
+
address@hidden
FreeBSD @command{make} does not conform to @sc{posix} in its handling
of file modification times, which causes it to loop while building libtool.
Consider using a different @command{such} as GNU make instead.
Index: tests/template.at
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/template.at,v
retrieving revision 1.10
diff -u -r1.10 template.at
--- tests/template.at 19 Feb 2007 08:57:07 -0000 1.10
+++ tests/template.at 19 Feb 2007 09:01:53 -0000
@@ -122,6 +122,16 @@
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 @@
[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 @@
[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,