diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2021-03-28 14:48:17 +0100 |
---|---|---|
committer | Iain Sandoe <iain@sandoe.co.uk> | 2023-10-22 19:30:02 +0100 |
commit | 6a6d3817afa02bbcd2388c8e005da6faf88932f1 (patch) | |
tree | f5997d899baddd1788da7a28f48bfbaa278355f9 /libgm2 | |
parent | 829b0c4cbabbe5056b79a8a1ec4cd9e9d928a5fb (diff) | |
download | gcc-6a6d3817afa02bbcd2388c8e005da6faf88932f1.zip gcc-6a6d3817afa02bbcd2388c8e005da6faf88932f1.tar.gz gcc-6a6d3817afa02bbcd2388c8e005da6faf88932f1.tar.bz2 |
Config,Darwin: Allow for configuring Darwin to use embedded runpath.
Recent Darwin versions place contraints on the use of run paths
specified in environment variables. This breaks some assumptions
in the GCC build.
This change allows the user to configure a Darwin build to use
'@rpath/libraryname.dylib' in library names and then to add an
embedded runpath to executables (and libraries with dependents).
The embedded runpath is added by default unless the user adds
'-nodefaultrpaths' to the link line.
For an installed compiler, it means that any executable built with
that compiler will reference the runtimes installed with the
compiler (equivalent to hard-coding the library path into the name
of the library).
During build-time configurations any "-B" entries will be added to
the runpath thus the newly-built libraries will be found by exes.
Since the install name is set in libtool, that decision needs to be
available here (but might also cause dependent ones in Makefiles,
so we need to export a conditional).
This facility is not available for Darwin 8 or earlier, however the
existing environment variable runpath does work there.
We default this on for systems where the external DYLD_LIBRARY_PATH
does not work and off for Darwin 8 or earlier. For systems that can
use either method, if the value is unset, we use the default (which
is currently DYLD_LIBRARY_PATH).
ChangeLog:
* configure: Regenerate.
* configure.ac: Do not add default runpaths to GCC exes
when we are building -static-libstdc++/-static-libgcc (the
default).
* libtool.m4: Add 'enable-darwin-at-runpath'. Act on the
enable flag to alter Darwin libraries to use @rpath names.
gcc/ChangeLog:
* aclocal.m4: Regenerate.
* configure: Regenerate.
* configure.ac: Handle Darwin rpaths.
* config/darwin.h: Handle Darwin rpaths.
* config/darwin.opt: Handle Darwin rpaths.
* Makefile.in: Handle Darwin rpaths.
gcc/ada/ChangeLog:
* gcc-interface/Makefile.in: Handle Darwin rpaths.
gcc/jit/ChangeLog:
* Make-lang.in: Handle Darwin rpaths.
libatomic/ChangeLog:
* Makefile.am: Handle Darwin rpaths.
* Makefile.in: Regenerate.
* configure: Regenerate.
* configure.ac: Handle Darwin rpaths.
libbacktrace/ChangeLog:
* configure: Regenerate.
* configure.ac: Handle Darwin rpaths.
libcc1/ChangeLog:
* configure: Regenerate.
libffi/ChangeLog:
* Makefile.am: Handle Darwin rpaths.
* Makefile.in: Regenerate.
* configure: Regenerate.
libgcc/ChangeLog:
* config/t-slibgcc-darwin: Generate libgcc_s
with an @rpath name.
* config.host: Handle Darwin rpaths.
libgfortran/ChangeLog:
* Makefile.am: Handle Darwin rpaths.
* Makefile.in: Regenerate.
* configure: Regenerate.
* configure.ac: Handle Darwin rpaths
libgm2/ChangeLog:
* Makefile.am: Handle Darwin rpaths.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* configure.ac: Handle Darwin rpaths.
* libm2cor/Makefile.am: Handle Darwin rpaths.
* libm2cor/Makefile.in: Regenerate.
* libm2iso/Makefile.am: Handle Darwin rpaths.
* libm2iso/Makefile.in: Regenerate.
* libm2log/Makefile.am: Handle Darwin rpaths.
* libm2log/Makefile.in: Regenerate.
* libm2min/Makefile.am: Handle Darwin rpaths.
* libm2min/Makefile.in: Regenerate.
* libm2pim/Makefile.am: Handle Darwin rpaths.
* libm2pim/Makefile.in: Regenerate.
libgomp/ChangeLog:
* Makefile.am: Handle Darwin rpaths.
* Makefile.in: Regenerate.
* configure: Regenerate.
* configure.ac: Handle Darwin rpaths
libitm/ChangeLog:
* Makefile.am: Handle Darwin rpaths.
* Makefile.in: Regenerate.
* configure: Regenerate.
* configure.ac: Handle Darwin rpaths.
libobjc/ChangeLog:
* configure: Regenerate.
* configure.ac: Handle Darwin rpaths.
libphobos/ChangeLog:
* configure: Regenerate.
* configure.ac: Handle Darwin rpaths.
* libdruntime/Makefile.am: Handle Darwin rpaths.
* libdruntime/Makefile.in: Regenerate.
* src/Makefile.am: Handle Darwin rpaths.
* src/Makefile.in: Regenerate.
libquadmath/ChangeLog:
* Makefile.am: Handle Darwin rpaths.
* Makefile.in: Regenerate.
* configure: Regenerate.
* configure.ac: Handle Darwin rpaths.
libsanitizer/ChangeLog:
* asan/Makefile.am: Handle Darwin rpaths.
* asan/Makefile.in: Regenerate.
* configure: Regenerate.
* hwasan/Makefile.am: Handle Darwin rpaths.
* hwasan/Makefile.in: Regenerate.
* lsan/Makefile.am: Handle Darwin rpaths.
* lsan/Makefile.in: Regenerate.
* tsan/Makefile.am: Handle Darwin rpaths.
* tsan/Makefile.in: Regenerate.
* ubsan/Makefile.am: Handle Darwin rpaths.
* ubsan/Makefile.in: Regenerate.
libssp/ChangeLog:
* Makefile.am: Handle Darwin rpaths.
* Makefile.in: Regenerate.
* configure: Regenerate.
* configure.ac: Handle Darwin rpaths.
libstdc++-v3/ChangeLog:
* configure: Regenerate.
* configure.ac: Handle Darwin rpaths.
* src/Makefile.am: Handle Darwin rpaths.
* src/Makefile.in: Regenerate.
libvtv/ChangeLog:
* configure: Regenerate.
* configure.ac: Handle Darwin rpaths.
lto-plugin/ChangeLog:
* configure: Regenerate.
* configure.ac: Handle Darwin rpaths.
zlib/ChangeLog:
* configure: Regenerate.
* configure.ac: Handle Darwin rpaths.
Diffstat (limited to 'libgm2')
-rw-r--r-- | libgm2/Makefile.am | 9 | ||||
-rw-r--r-- | libgm2/Makefile.in | 15 | ||||
-rw-r--r-- | libgm2/aclocal.m4 | 10 | ||||
-rwxr-xr-x | libgm2/configure | 145 | ||||
-rw-r--r-- | libgm2/configure.ac | 6 | ||||
-rw-r--r-- | libgm2/libm2cor/Makefile.am | 4 | ||||
-rw-r--r-- | libgm2/libm2cor/Makefile.in | 17 | ||||
-rw-r--r-- | libgm2/libm2iso/Makefile.am | 4 | ||||
-rw-r--r-- | libgm2/libm2iso/Makefile.in | 17 | ||||
-rw-r--r-- | libgm2/libm2log/Makefile.am | 3 | ||||
-rw-r--r-- | libgm2/libm2log/Makefile.in | 17 | ||||
-rw-r--r-- | libgm2/libm2min/Makefile.am | 3 | ||||
-rw-r--r-- | libgm2/libm2min/Makefile.in | 17 | ||||
-rw-r--r-- | libgm2/libm2pim/Makefile.am | 3 | ||||
-rw-r--r-- | libgm2/libm2pim/Makefile.in | 17 |
15 files changed, 227 insertions, 60 deletions
diff --git a/libgm2/Makefile.am b/libgm2/Makefile.am index de060aa..d2eadfc 100644 --- a/libgm2/Makefile.am +++ b/libgm2/Makefile.am @@ -48,6 +48,12 @@ SUBDIRS = libm2min libm2log libm2cor libm2iso libm2pim GM2_BUILDDIR := $(shell pwd) gm2_cdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include +if ENABLE_DARWIN_AT_RPATH +DARWIN_AT_RPATH=yes +else +DARWIN_AT_RPATH=yes +endif + # Work around what appears to be a GNU make bug handling MAKEFLAGS # values defined in terms of make variables, as is the case for CC and # friends when we are called from the top level Makefile. @@ -95,7 +101,8 @@ AM_MAKEFLAGS = \ "TARGET_LIB_PATH=$(TARGET_LIB_PATH)" \ "TARGET_LIB_PATH_libgm2=$(TARGET_LIB_PATH_libgm2)" \ "TARGET_LONGDOUBLE_ABI=$(TARGET_LONGDOUBLE_ABI)" \ - "LIBTOOL=$(GM2_BUILDDIR)/libtool" + "LIBTOOL=$(GM2_BUILDDIR)/libtool" \ + "DARWIN_AT_RPATH=$(DARWIN_AT_RPATH)" # Subdir rules rely on $(FLAGS_TO_PASS) FLAGS_TO_PASS = $(AM_MAKEFLAGS) diff --git a/libgm2/Makefile.in b/libgm2/Makefile.in index 0900c02..47fbf69 100644 --- a/libgm2/Makefile.in +++ b/libgm2/Makefile.in @@ -90,15 +90,15 @@ host_triplet = @host@ target_triplet = @target@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ - $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ - $(top_srcdir)/../config/acx.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../config/lead-dot.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/../config/override.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ @@ -344,6 +344,8 @@ GM2_SRC = $(GCC_DIR)/m2 SUBDIRS = libm2min libm2log libm2cor libm2iso libm2pim GM2_BUILDDIR := $(shell pwd) gm2_cdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include +@ENABLE_DARWIN_AT_RPATH_FALSE@DARWIN_AT_RPATH = yes +@ENABLE_DARWIN_AT_RPATH_TRUE@DARWIN_AT_RPATH = yes # Work around what appears to be a GNU make bug handling MAKEFLAGS # values defined in terms of make variables, as is the case for CC and @@ -392,7 +394,8 @@ AM_MAKEFLAGS = \ "TARGET_LIB_PATH=$(TARGET_LIB_PATH)" \ "TARGET_LIB_PATH_libgm2=$(TARGET_LIB_PATH_libgm2)" \ "TARGET_LONGDOUBLE_ABI=$(TARGET_LONGDOUBLE_ABI)" \ - "LIBTOOL=$(GM2_BUILDDIR)/libtool" + "LIBTOOL=$(GM2_BUILDDIR)/libtool" \ + "DARWIN_AT_RPATH=$(DARWIN_AT_RPATH)" # Subdir rules rely on $(FLAGS_TO_PASS) diff --git a/libgm2/aclocal.m4 b/libgm2/aclocal.m4 index c352303..832065f 100644 --- a/libgm2/aclocal.m4 +++ b/libgm2/aclocal.m4 @@ -1187,14 +1187,14 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR -m4_include([../libtool.m4]) -m4_include([../ltoptions.m4]) -m4_include([../ltsugar.m4]) -m4_include([../ltversion.m4]) -m4_include([../lt~obsolete.m4]) m4_include([../config/acx.m4]) m4_include([../config/depstand.m4]) m4_include([../config/lead-dot.m4]) m4_include([../config/multi.m4]) m4_include([../config/no-executables.m4]) m4_include([../config/override.m4]) +m4_include([../libtool.m4]) +m4_include([../ltoptions.m4]) +m4_include([../ltsugar.m4]) +m4_include([../ltversion.m4]) +m4_include([../lt~obsolete.m4]) diff --git a/libgm2/configure b/libgm2/configure index 072d584..d55a7f4 100755 --- a/libgm2/configure +++ b/libgm2/configure @@ -649,6 +649,8 @@ GM2_FOR_TARGET CC_FOR_BUILD enable_static enable_shared +ENABLE_DARWIN_AT_RPATH_FALSE +ENABLE_DARWIN_AT_RPATH_TRUE CXXCPP OTOOL64 OTOOL @@ -805,6 +807,7 @@ with_pic enable_fast_install with_gnu_ld enable_libtool_lock +enable_darwin_at_rpath with_gcc_major_version_only ' ac_precious_vars='build_alias @@ -1455,6 +1458,9 @@ Optional Features: --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) + --enable-darwin-at-rpath + install libraries with @rpath/library-name, requires + rpaths to be added to executables Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -6569,10 +6575,6 @@ fi -enable_dlopen=yes - - - case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 @@ -9181,7 +9183,7 @@ $as_echo "$lt_cv_ld_force_load" >&6; } # darwin 5.x (macOS 10.1) onwards we only need to adjust when the # deployment target is forced to an earlier version. case ${MACOSX_DEPLOYMENT_TARGET-UNSET},$host in - UNSET,*-darwin[89]*|UNSET,*-darwin[12][0123456789]*) + UNSET,*-darwin[89]*|UNSET,*-darwin[12][0-9]*) ;; 10.[012][,.]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' @@ -9229,6 +9231,8 @@ done + enable_dlopen=no + enable_win32_dll=no @@ -10892,6 +10896,49 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi darwin* | rhapsody*) + + # Publish an arg to allow the user to select that Darwin host (and target) + # libraries should be given install-names like @rpath/libfoo.dylib. This + # requires that the user of the library then adds an 'rpath' to the DSO that + # needs access. + # NOTE: there are defaults below, for systems that support rpaths. The person + # configuring can override the defaults for any system version that supports + # them - they are, however, forced off for system versions without support. + # Check whether --enable-darwin-at-rpath was given. +if test "${enable_darwin_at_rpath+set}" = set; then : + enableval=$enable_darwin_at_rpath; if test "x$enable_darwin_at_rpath" = "xyes"; then + # This is not supported before macOS 10.5 / Darwin9. + case ${MACOSX_DEPLOYMENT_TARGET-UNSET},$host_os in + UNSET,darwin[4-8]*|UNSET,rhapsody*|10.[0-4][,.]*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Darwin @rpath library names are incompatible with OSX versions earlier than 10.5 (rpaths disabled)" >&5 +$as_echo "$as_me: WARNING: Darwin @rpath library names are incompatible with OSX versions earlier than 10.5 (rpaths disabled)" >&2;} + enable_darwin_at_rpath=no + ;; + esac + fi +else + case ${MACOSX_DEPLOYMENT_TARGET-UNSET},$host_os in + # As above, before 10.5 / Darwin9 this does not work. + UNSET,darwin[4-8]*|UNSET,rhapsody*|10.[0-4][,.]*) + enable_darwin_at_rpath=no + ;; + + # We cannot build and test reliably on macOS 10.11+ (Darwin15+) without use + # of rpaths, since runpaths set via DYLD_LIBRARY_PATH are elided by key + # system executables (e.g. /bin/sh). Force rpaths on for these systems. + UNSET,darwin1[5-9]*|UNSET,darwin2*|10.1[1-9][,.]*|1[1-9].*[,.]* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: @rpath library names are needed on macOS versions later than 10.11 (rpaths have been enabled)" >&5 +$as_echo "$as_me: @rpath library names are needed on macOS versions later than 10.11 (rpaths have been enabled)" >&6;} + enable_darwin_at_rpath=yes + ;; + # NOTE: we are not (yet) doing anything for 10.5 .. 10.10, since they can + # work with either DYLD_LIBRARY_PATH or embedded rpaths. + + esac + +fi + + archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes @@ -10909,9 +10956,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _lt_install_name='\$rpath/\$soname' + if test "x$enable_darwin_at_rpath" = "xyes"; then + _lt_install_name='@rpath/\$soname' + fi + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name ${_lt_install_name} \$verstring ${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name ${_lt_install_name} \$verstring ${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else @@ -12738,7 +12789,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12741 "configure" +#line 12792 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12844,7 +12895,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12847 "configure" +#line 12898 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13726,6 +13777,49 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi darwin* | rhapsody*) + + # Publish an arg to allow the user to select that Darwin host (and target) + # libraries should be given install-names like @rpath/libfoo.dylib. This + # requires that the user of the library then adds an 'rpath' to the DSO that + # needs access. + # NOTE: there are defaults below, for systems that support rpaths. The person + # configuring can override the defaults for any system version that supports + # them - they are, however, forced off for system versions without support. + # Check whether --enable-darwin-at-rpath was given. +if test "${enable_darwin_at_rpath+set}" = set; then : + enableval=$enable_darwin_at_rpath; if test "x$enable_darwin_at_rpath" = "xyes"; then + # This is not supported before macOS 10.5 / Darwin9. + case ${MACOSX_DEPLOYMENT_TARGET-UNSET},$host_os in + UNSET,darwin[4-8]*|UNSET,rhapsody*|10.[0-4][,.]*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Darwin @rpath library names are incompatible with OSX versions earlier than 10.5 (rpaths disabled)" >&5 +$as_echo "$as_me: WARNING: Darwin @rpath library names are incompatible with OSX versions earlier than 10.5 (rpaths disabled)" >&2;} + enable_darwin_at_rpath=no + ;; + esac + fi +else + case ${MACOSX_DEPLOYMENT_TARGET-UNSET},$host_os in + # As above, before 10.5 / Darwin9 this does not work. + UNSET,darwin[4-8]*|UNSET,rhapsody*|10.[0-4][,.]*) + enable_darwin_at_rpath=no + ;; + + # We cannot build and test reliably on macOS 10.11+ (Darwin15+) without use + # of rpaths, since runpaths set via DYLD_LIBRARY_PATH are elided by key + # system executables (e.g. /bin/sh). Force rpaths on for these systems. + UNSET,darwin1[5-9]*|UNSET,darwin2*|10.1[1-9][,.]*|1[1-9].*[,.]* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: @rpath library names are needed on macOS versions later than 10.11 (rpaths have been enabled)" >&5 +$as_echo "$as_me: @rpath library names are needed on macOS versions later than 10.11 (rpaths have been enabled)" >&6;} + enable_darwin_at_rpath=yes + ;; + # NOTE: we are not (yet) doing anything for 10.5 .. 10.10, since they can + # work with either DYLD_LIBRARY_PATH or embedded rpaths. + + esac + +fi + + archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes @@ -13743,12 +13837,20 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all - archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _lt_install_name='\$rpath/\$soname' + if test "x$enable_darwin_at_rpath" = "xyes"; then + _lt_install_name='@rpath/\$soname' + fi + archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name ${_lt_install_name} \$verstring ${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name ${_lt_install_name} \$verstring ${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then - archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _lt_install_name='\$rpath/\$soname' + if test "x$enable_darwin_at_rpath" = "xyes"; then + _lt_install_name='@rpath/\$soname' + fi + archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name ${_lt_install_name} \$verstring${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi @@ -16122,6 +16224,21 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +enable_dlopen=yes + + + + + if test x$enable_darwin_at_rpath = xyes; then + ENABLE_DARWIN_AT_RPATH_TRUE= + ENABLE_DARWIN_AT_RPATH_FALSE='#' +else + ENABLE_DARWIN_AT_RPATH_TRUE='#' + ENABLE_DARWIN_AT_RPATH_FALSE= +fi + + + if test "${multilib}" = "yes"; then @@ -20310,6 +20427,10 @@ if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${ENABLE_DARWIN_AT_RPATH_TRUE}" && test -z "${ENABLE_DARWIN_AT_RPATH_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_DARWIN_AT_RPATH\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${BUILD_PIMLIB_TRUE}" && test -z "${BUILD_PIMLIB_FALSE}"; then as_fn_error $? "conditional \"BUILD_PIMLIB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/libgm2/configure.ac b/libgm2/configure.ac index 92e76c9..5701b95 100644 --- a/libgm2/configure.ac +++ b/libgm2/configure.ac @@ -212,8 +212,12 @@ AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error) AC_PROG_MAKE_SET AC_PROG_INSTALL -AC_LIBTOOL_DLOPEN AM_PROG_LIBTOOL +LT_INIT +AC_LIBTOOL_DLOPEN + +AM_CONDITIONAL([ENABLE_DARWIN_AT_RPATH], [test x$enable_darwin_at_rpath = xyes]) + AC_SUBST(enable_shared) AC_SUBST(enable_static) diff --git a/libgm2/libm2cor/Makefile.am b/libgm2/libm2cor/Makefile.am index 4c36c54..a515bd2 100644 --- a/libgm2/libm2cor/Makefile.am +++ b/libgm2/libm2cor/Makefile.am @@ -129,6 +129,10 @@ libm2cor_la_link_flags = -Wl,-undefined,dynamic_lookup else libm2cor_la_link_flags = endif +if ENABLE_DARWIN_AT_RPATH +libm2cor_la_link_flags += -nodefaultrpaths -Wl,-rpath,@loader_path/ +endif + libm2cor_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2cor_la_link_flags) BUILT_SOURCES = SYSTEM.def CLEANFILES = SYSTEM.def diff --git a/libgm2/libm2cor/Makefile.in b/libgm2/libm2cor/Makefile.in index eaf980e..449a26b 100644 --- a/libgm2/libm2cor/Makefile.in +++ b/libgm2/libm2cor/Makefile.in @@ -105,17 +105,18 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ +@BUILD_CORLIB_TRUE@@ENABLE_DARWIN_AT_RPATH_TRUE@am__append_1 = -nodefaultrpaths -Wl,-rpath,@loader_path/ subdir = libm2cor ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ - $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ - $(top_srcdir)/../config/acx.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../config/lead-dot.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/../config/override.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am @@ -475,8 +476,10 @@ FLAGS_TO_PASS = $(AM_MAKEFLAGS) @BUILD_CORLIB_TRUE@ -fm2-g -g -Wcase-enum -Wreturn-type -fcase -fm2-prefix=m2cor \ @BUILD_CORLIB_TRUE@ $(TARGET_LONGDOUBLE_ABI) -@BUILD_CORLIB_TRUE@@TARGET_DARWIN_FALSE@libm2cor_la_link_flags = -@BUILD_CORLIB_TRUE@@TARGET_DARWIN_TRUE@libm2cor_la_link_flags = -Wl,-undefined,dynamic_lookup +@BUILD_CORLIB_TRUE@@TARGET_DARWIN_FALSE@libm2cor_la_link_flags = \ +@BUILD_CORLIB_TRUE@@TARGET_DARWIN_FALSE@ $(am__append_1) +@BUILD_CORLIB_TRUE@@TARGET_DARWIN_TRUE@libm2cor_la_link_flags = -Wl,-undefined,dynamic_lookup \ +@BUILD_CORLIB_TRUE@@TARGET_DARWIN_TRUE@ $(am__append_1) @BUILD_CORLIB_TRUE@libm2cor_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2cor_la_link_flags) @BUILD_CORLIB_TRUE@BUILT_SOURCES = SYSTEM.def @BUILD_CORLIB_TRUE@CLEANFILES = SYSTEM.def diff --git a/libgm2/libm2iso/Makefile.am b/libgm2/libm2iso/Makefile.am index 933f694..ddd2462 100644 --- a/libgm2/libm2iso/Makefile.am +++ b/libgm2/libm2iso/Makefile.am @@ -203,6 +203,10 @@ libm2iso_la_link_flags = -Wl,-undefined,dynamic_lookup else libm2iso_la_link_flags = endif +if ENABLE_DARWIN_AT_RPATH +libm2iso_la_link_flags += -nodefaultrpaths -Wl,-rpath,@loader_path/ +endif + libm2iso_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2iso_la_link_flags) CLEANFILES = SYSTEM.def BUILT_SOURCES = SYSTEM.def diff --git a/libgm2/libm2iso/Makefile.in b/libgm2/libm2iso/Makefile.in index b150c69..6700664 100644 --- a/libgm2/libm2iso/Makefile.in +++ b/libgm2/libm2iso/Makefile.in @@ -105,17 +105,18 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ +@BUILD_ISOLIB_TRUE@@ENABLE_DARWIN_AT_RPATH_TRUE@am__append_1 = -nodefaultrpaths -Wl,-rpath,@loader_path/ subdir = libm2iso ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ - $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ - $(top_srcdir)/../config/acx.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../config/lead-dot.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/../config/override.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am @@ -576,8 +577,10 @@ FLAGS_TO_PASS = $(AM_MAKEFLAGS) @BUILD_ISOLIB_TRUE@ -fiso -fextended-opaque -fm2-g -g -Wcase-enum -Wreturn-type -fcase -fm2-prefix=m2iso \ @BUILD_ISOLIB_TRUE@ $(TARGET_LONGDOUBLE_ABI) -@BUILD_ISOLIB_TRUE@@TARGET_DARWIN_FALSE@libm2iso_la_link_flags = -@BUILD_ISOLIB_TRUE@@TARGET_DARWIN_TRUE@libm2iso_la_link_flags = -Wl,-undefined,dynamic_lookup +@BUILD_ISOLIB_TRUE@@TARGET_DARWIN_FALSE@libm2iso_la_link_flags = \ +@BUILD_ISOLIB_TRUE@@TARGET_DARWIN_FALSE@ $(am__append_1) +@BUILD_ISOLIB_TRUE@@TARGET_DARWIN_TRUE@libm2iso_la_link_flags = -Wl,-undefined,dynamic_lookup \ +@BUILD_ISOLIB_TRUE@@TARGET_DARWIN_TRUE@ $(am__append_1) @BUILD_ISOLIB_TRUE@libm2iso_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2iso_la_link_flags) @BUILD_ISOLIB_TRUE@CLEANFILES = SYSTEM.def @BUILD_ISOLIB_TRUE@BUILT_SOURCES = SYSTEM.def diff --git a/libgm2/libm2log/Makefile.am b/libgm2/libm2log/Makefile.am index a95e5c8..9571d50 100644 --- a/libgm2/libm2log/Makefile.am +++ b/libgm2/libm2log/Makefile.am @@ -144,6 +144,9 @@ libm2log_la_link_flags = -Wl,-undefined,dynamic_lookup else libm2log_la_link_flags = endif +if ENABLE_DARWIN_AT_RPATH +libm2log_la_link_flags += -nodefaultrpaths -Wl,-rpath,@loader_path/ +endif libm2log_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2log_la_link_flags) BUILT_SOURCES = ../libm2pim/SYSTEM.def diff --git a/libgm2/libm2log/Makefile.in b/libgm2/libm2log/Makefile.in index 4e5580d..9b9b416 100644 --- a/libgm2/libm2log/Makefile.in +++ b/libgm2/libm2log/Makefile.in @@ -105,17 +105,18 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ +@BUILD_LOGLIB_TRUE@@ENABLE_DARWIN_AT_RPATH_TRUE@am__append_1 = -nodefaultrpaths -Wl,-rpath,@loader_path/ subdir = libm2log ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ - $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ - $(top_srcdir)/../config/acx.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../config/lead-dot.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/../config/override.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am @@ -479,8 +480,10 @@ FLAGS_TO_PASS = $(AM_MAKEFLAGS) @BUILD_LOGLIB_TRUE@ -Wcase-enum -Wreturn-type -fcase -fm2-prefix=m2log \ @BUILD_LOGLIB_TRUE@ $(TARGET_LONGDOUBLE_ABI) -@BUILD_LOGLIB_TRUE@@TARGET_DARWIN_FALSE@libm2log_la_link_flags = -@BUILD_LOGLIB_TRUE@@TARGET_DARWIN_TRUE@libm2log_la_link_flags = -Wl,-undefined,dynamic_lookup +@BUILD_LOGLIB_TRUE@@TARGET_DARWIN_FALSE@libm2log_la_link_flags = \ +@BUILD_LOGLIB_TRUE@@TARGET_DARWIN_FALSE@ $(am__append_1) +@BUILD_LOGLIB_TRUE@@TARGET_DARWIN_TRUE@libm2log_la_link_flags = -Wl,-undefined,dynamic_lookup \ +@BUILD_LOGLIB_TRUE@@TARGET_DARWIN_TRUE@ $(am__append_1) @BUILD_LOGLIB_TRUE@libm2log_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2log_la_link_flags) @BUILD_LOGLIB_TRUE@BUILT_SOURCES = ../libm2pim/SYSTEM.def @BUILD_LOGLIB_TRUE@M2LIBDIR = /m2/m2log/ diff --git a/libgm2/libm2min/Makefile.am b/libgm2/libm2min/Makefile.am index 8caaf7a..ab627e8 100644 --- a/libgm2/libm2min/Makefile.am +++ b/libgm2/libm2min/Makefile.am @@ -115,6 +115,9 @@ libm2min_la_link_flags = -Wl,-undefined,dynamic_lookup else libm2min_la_link_flags = endif +if ENABLE_DARWIN_AT_RPATH +libm2min_la_link_flags += -nodefaultrpaths -Wl,-rpath,@loader_path/ +endif libm2min_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2min_la_link_flags) BUILT_SOURCES = SYSTEM.def CLEANFILES = SYSTEM.def diff --git a/libgm2/libm2min/Makefile.in b/libgm2/libm2min/Makefile.in index 790cfb3..4a909c7 100644 --- a/libgm2/libm2min/Makefile.in +++ b/libgm2/libm2min/Makefile.in @@ -105,17 +105,18 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ +@ENABLE_DARWIN_AT_RPATH_TRUE@am__append_1 = -nodefaultrpaths -Wl,-rpath,@loader_path/ subdir = libm2min ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ - $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ - $(top_srcdir)/../config/acx.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../config/lead-dot.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/../config/override.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am @@ -443,8 +444,10 @@ libm2min_la_M2FLAGS = \ -fno-m2-plugin -fno-scaffold-dynamic -fno-scaffold-main -fm2-prefix=m2min \ $(TARGET_LONGDOUBLE_ABI) -@TARGET_DARWIN_FALSE@libm2min_la_link_flags = -@TARGET_DARWIN_TRUE@libm2min_la_link_flags = -Wl,-undefined,dynamic_lookup +@TARGET_DARWIN_FALSE@libm2min_la_link_flags = $(am__append_1) +@TARGET_DARWIN_TRUE@libm2min_la_link_flags = \ +@TARGET_DARWIN_TRUE@ -Wl,-undefined,dynamic_lookup \ +@TARGET_DARWIN_TRUE@ $(am__append_1) libm2min_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2min_la_link_flags) BUILT_SOURCES = SYSTEM.def CLEANFILES = SYSTEM.def diff --git a/libgm2/libm2pim/Makefile.am b/libgm2/libm2pim/Makefile.am index f940dd2..dd1fd08 100644 --- a/libgm2/libm2pim/Makefile.am +++ b/libgm2/libm2pim/Makefile.am @@ -180,6 +180,9 @@ libm2pim_la_link_flags = -Wl,-undefined,dynamic_lookup else libm2pim_la_link_flags = endif +if ENABLE_DARWIN_AT_RPATH +libm2pim_la_link_flags += -nodefaultrpaths -Wl,-rpath,@loader_path/ +endif libm2pim_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2pim_la_link_flags) BUILT_SOURCES = SYSTEM.def CLEANFILES = SYSTEM.def diff --git a/libgm2/libm2pim/Makefile.in b/libgm2/libm2pim/Makefile.in index 5fc026e..e64722e 100644 --- a/libgm2/libm2pim/Makefile.in +++ b/libgm2/libm2pim/Makefile.in @@ -105,17 +105,18 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ +@BUILD_PIMLIB_TRUE@@ENABLE_DARWIN_AT_RPATH_TRUE@am__append_1 = -nodefaultrpaths -Wl,-rpath,@loader_path/ subdir = libm2pim ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ - $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ - $(top_srcdir)/../config/acx.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../config/lead-dot.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/../config/override.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am @@ -544,8 +545,10 @@ FLAGS_TO_PASS = $(AM_MAKEFLAGS) @BUILD_PIMLIB_TRUE@ -fm2-g -g -Wcase-enum -Wreturn-type -fcase -fm2-prefix=m2pim \ @BUILD_PIMLIB_TRUE@ $(TARGET_LONGDOUBLE_ABI) -@BUILD_PIMLIB_TRUE@@TARGET_DARWIN_FALSE@libm2pim_la_link_flags = -@BUILD_PIMLIB_TRUE@@TARGET_DARWIN_TRUE@libm2pim_la_link_flags = -Wl,-undefined,dynamic_lookup +@BUILD_PIMLIB_TRUE@@TARGET_DARWIN_FALSE@libm2pim_la_link_flags = \ +@BUILD_PIMLIB_TRUE@@TARGET_DARWIN_FALSE@ $(am__append_1) +@BUILD_PIMLIB_TRUE@@TARGET_DARWIN_TRUE@libm2pim_la_link_flags = -Wl,-undefined,dynamic_lookup \ +@BUILD_PIMLIB_TRUE@@TARGET_DARWIN_TRUE@ $(am__append_1) @BUILD_PIMLIB_TRUE@libm2pim_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2pim_la_link_flags) @BUILD_PIMLIB_TRUE@BUILT_SOURCES = SYSTEM.def @BUILD_PIMLIB_TRUE@CLEANFILES = SYSTEM.def |