]> git.saurik.com Git - wxWidgets.git/commitdiff
use install_name_tool so that samples use uninstalled shared libs on OSX
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 10 Aug 2003 16:38:38 +0000 (16:38 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 10 Aug 2003 16:38:38 +0000 (16:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22742 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

build/bakefiles/common_samples.bkl
build/bakefiles/config.bkl
configure
configure.in
samples/minimal/Makefile.in

index 892a3b867ab9c8bc633de4df3860c3f9bd2b1466..735f3f64a1808ddd063a099ce5221ab1bdbfcf3b 100644 (file)
     </template>
     
     <template id="wx_sample" template="wx_util">
     </template>
     
     <template id="wx_sample" template="wx_util">
-        <ldflags>$(SAMPLES_RPATH_FLAG)</ldflags>
+        <if cond="FORMAT=='autoconf'">
+            <ldflags>$(SAMPLES_RPATH_FLAG)</ldflags>
+            <__command>$(LF)$(SAMPLES_RPATH_POSTLINK)</__command>
+        </if>
     </template>
     <template id="wx_sample_console" template="wx_util_console">
     </template>
     <template id="wx_sample_console" template="wx_util_console">
-        <ldflags>$(SAMPLES_RPATH_FLAG)</ldflags>
+        <if cond="FORMAT=='autoconf'">
+            <ldflags>$(SAMPLES_RPATH_FLAG)</ldflags>
+            <__command>$(SAMPLES_RPATH_POSTLINK)</__command>
+        </if>
     </template>
 
     
     </template>
 
     
index 28e94c95d199fbfaa87a381223af1300f241f223..9e2d2e887ac243765b76cdb296fff3a4260e11e4 100644 (file)
@@ -168,8 +168,9 @@ compiled .lib files and setup.h under the lib/ toplevel directory.
         <option name="EXTRALIBS_ODBC"/>
         <option name="EXTRALIBS_GUI"/>
         <option name="EXTRALIBS_OPENGL"/>
         <option name="EXTRALIBS_ODBC"/>
         <option name="EXTRALIBS_GUI"/>
         <option name="EXTRALIBS_OPENGL"/>
-        <option name="SAMPLES_RPATH_FLAG"/>
         <option name="HOST_SUFFIX"/>
         <option name="HOST_SUFFIX"/>
+        <option name="SAMPLES_RPATH_FLAG"/>
+        <option name="SAMPLES_RPATH_POSTLINK"/>
         
         <set var="TOP_SRCDIR">$(top_srcdir)/</set>
         <set var="RUNTIME_LIBS">dynamic</set>
         
         <set var="TOP_SRCDIR">$(top_srcdir)/</set>
         <set var="RUNTIME_LIBS">dynamic</set>
@@ -197,7 +198,6 @@ it if SHARED=1 unless you know what you are doing.
         <set var="TOOLKIT">MSW</set>
         <set var="TOOLKIT_LOWERCASE">$(TOOLKIT.lower())</set>
         <set var="TOOLKIT_VERSION"/>
         <set var="TOOLKIT">MSW</set>
         <set var="TOOLKIT_LOWERCASE">$(TOOLKIT.lower())</set>
         <set var="TOOLKIT_VERSION"/>
-        <set var="SAMPLES_RPATH_FLAG"/>
         <set var="HOST_SUFFIX"/>
         <set var="EXTRALIBS"/>
         <set var="EXTRALIBS_XML"/>
         <set var="HOST_SUFFIX"/>
         <set var="EXTRALIBS"/>
         <set var="EXTRALIBS_XML"/>
index 7b021e92bdbaa35271fcd0b2e59bd65a1c4d9e37..7aa46683703c28d2af0bc9a7f564592c5bcb4a04 100755 (executable)
--- a/configure
+++ b/configure
@@ -25346,14 +25346,6 @@ echo "${ECHO_T}$wx_cv_version_script" >&6
     case "${host}" in
       *-*-linux* | *-*-gnu* )
         SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(top_builddir)lib"
     case "${host}" in
       *-*-linux* | *-*-gnu* )
         SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(top_builddir)lib"
-        SAMPLES_RPATH_POSTLINK="\"libnames=\`cd \$(LIBDIRNAME) ; ls -1 | grep '\.so\.[0-9][0-9]*\$'\` ; \\\\
-inst_cmd='install_name_tool ' ; \\\\
-for i in \$libnames ; do \\\\
-    inst_cmd=\"\$inst_cmd -change \$(prefix)/lib/\\$i \$(LIBDIRNAME)/\\$i\" ; \\\\
-done ; \\\\
-echo \$inst_cmd\""
-
-      ;;
 
       *-*-solaris2* )
         if test "$GCC" = yes ; then
 
       *-*-solaris2* )
         if test "$GCC" = yes ; then
@@ -25460,12 +25452,17 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
       ;;
 
       powerpc-*-darwin* )
       ;;
 
       powerpc-*-darwin* )
-        SAMPLES_RPATH_POSTLINK="libnames=\`cd \$(LIBDIRNAME) ; ls -1 | grep '\.so\.0-90-9*\$'\` ; \\
-inst_cmd='install_name_tool ' ; \\
-for i in \$libnames ; do \\
-    inst_cmd=\"\$inst_cmd -change \$(prefix)/lib/\\$i \$(LIBDIRNAME)/\\$i\" ; \\
-done ; \\
-echo \$inst_cmd "
+        SAMPLES_RPATH_POSTLINK="\$(top_builddir)change-install-names \$(LIBDIRNAME) \$(prefix) \$@"
+        cat <<EOF >change-install-names
+#!/bin/sh
+libnames=\`cd \${1} ; ls -1 | grep '\.[0-9][0-9]*\.dylib\$'\`
+inst_cmd="install_name_tool "
+for i in \${libnames} ; do
+    inst_cmd="\${inst_cmd} -change \${2}/lib/\${i} \${1}/\${i}"
+done
+\${inst_cmd} \${3}
+EOF
+        chmod +x change-install-names
       ;;
 
     esac
       ;;
 
     esac
index ae9be08ae7b9265d0dbd59dbc262ace75b0d0f5a..7677c204e9f3a3391d02315247527c30bfda7551 100644 (file)
@@ -140,6 +140,7 @@ DEFAULT_DEFAULT_wxUSE_X11=0
 PROGRAM_EXT=
 SO_SUFFIX=so
 SAMPLES_RPATH_FLAG=
 PROGRAM_EXT=
 SO_SUFFIX=so
 SAMPLES_RPATH_FLAG=
+SAMPLES_RPATH_POSTLINK=
 
 dnl to support a new system, you need to add its canonical name (as determined
 dnl by config.sub or specified by the configure command line) to this "case"
 
 dnl to support a new system, you need to add its canonical name (as determined
 dnl by config.sub or specified by the configure command line) to this "case"
@@ -3105,7 +3106,6 @@ if test "$wxUSE_SHARED" = "yes"; then
     case "${host}" in
       *-*-linux* | *-*-gnu* )
         SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(top_builddir)lib"
     case "${host}" in
       *-*-linux* | *-*-gnu* )
         SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(top_builddir)lib"
-      ;;
 
       *-*-solaris2* )
         if test "$GCC" = yes ; then
 
       *-*-solaris2* )
         if test "$GCC" = yes ; then
@@ -3144,6 +3144,21 @@ if test "$wxUSE_SHARED" = "yes"; then
             SAMPLES_RPATH_FLAG="-R\$(top_builddir)lib"
         fi
       ;;
             SAMPLES_RPATH_FLAG="-R\$(top_builddir)lib"
         fi
       ;;
+      
+      powerpc-*-darwin* )
+        SAMPLES_RPATH_POSTLINK="\$(top_builddir)change-install-names \$(LIBDIRNAME) \$(prefix) \$@"
+        cat <<EOF >change-install-names
+#!/bin/sh
+libnames=\`cd \${1} ; ls -1 | grep '\.[[0-9]][[0-9]]*\.dylib\$'\`
+inst_cmd="install_name_tool "
+for i in \${libnames} ; do
+    inst_cmd="\${inst_cmd} -change \${2}/lib/\${i} \${1}/\${i}"
+done
+\${inst_cmd} \${3}
+EOF
+        chmod +x change-install-names
+      ;;
+      
     esac
 
     dnl set target to shared if not explicitly chose static before
     esac
 
     dnl set target to shared if not explicitly chose static before
@@ -5629,6 +5644,7 @@ TOOLKIT_LOWERCASE=`echo $TOOLKIT | tr [[A-Z]] [[a-z]]`
 AC_SUBST(TOOLKIT_LOWERCASE)
 AC_SUBST(TOOLKIT_VERSION)
 AC_SUBST(SAMPLES_RPATH_FLAG)
 AC_SUBST(TOOLKIT_LOWERCASE)
 AC_SUBST(TOOLKIT_VERSION)
 AC_SUBST(SAMPLES_RPATH_FLAG)
+AC_SUBST(SAMPLES_RPATH_POSTLINK)
 AC_SUBST(HOST_SUFFIX)
 
 AC_BAKEFILE
 AC_SUBST(HOST_SUFFIX)
 
 AC_BAKEFILE
index 90506f04f14753bcfda7f5b09cc9bf5534d536d7..0d3f775a7f62bb358ef499cdd125b038ecc42b64 100644 (file)
@@ -21,6 +21,7 @@ LDFLAGS = @LDFLAGS@
 LDFLAGS_GUI = @LDFLAGS_GUI@
 RESCOMP = @RESCOMP@
 SAMPLES_RPATH_FLAG = @SAMPLES_RPATH_FLAG@
 LDFLAGS_GUI = @LDFLAGS_GUI@
 RESCOMP = @RESCOMP@
 SAMPLES_RPATH_FLAG = @SAMPLES_RPATH_FLAG@
+SAMPLES_RPATH_POSTLINK = @SAMPLES_RPATH_POSTLINK@
 SETFILE = @SETFILE@
 TOOLCHAIN_NAME = @TOOLCHAIN_NAME@
 TOOLKIT = @TOOLKIT@
 SETFILE = @SETFILE@
 TOOLCHAIN_NAME = @TOOLCHAIN_NAME@
 TOOLKIT = @TOOLKIT@
@@ -130,13 +131,12 @@ COND_PLATFORM_MAC_1___minimal___mac_rezcmd = $(RESCOMP) -d __DARWIN__ -t APPL -d
 all: minimal$(EXEEXT)
 
 clean: 
 all: minimal$(EXEEXT)
 
 clean: 
-       rm -rf ./.deps
+       rm -rf ./.deps ./.pch
        rm -f ./*.o
        rm -f minimal$(EXEEXT)
 
 distclean: clean
        rm -f ./*.o
        rm -f minimal$(EXEEXT)
 
 distclean: clean
-       rm -f configure config.cache config.log config.status
-       rm -f bk-deps shared-ld-sh
+       rm -f configure config.cache config.log config.status bk-deps bk-make-pch shared-ld-sh Makefile
 
 install: all
 
 
 install: all
 
@@ -146,6 +146,7 @@ minimal$(EXEEXT): $(MINIMAL_OBJECTS) $(__minimal___win32rc)
        $(CXX) -o $@ $(MINIMAL_OBJECTS) $(LDFLAGS)   -L$(LIBDIRNAME) $(LDFLAGS_GUI) $(SAMPLES_RPATH_FLAG)  $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(__LIB_ZLIB_p) $(__LIB_ODBC_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS) $(EXTRALIBS_GUI)
        $(__minimal___mac_rezcmd)
        $(__minimal___mac_setfilecmd)
        $(CXX) -o $@ $(MINIMAL_OBJECTS) $(LDFLAGS)   -L$(LIBDIRNAME) $(LDFLAGS_GUI) $(SAMPLES_RPATH_FLAG)  $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(__LIB_ZLIB_p) $(__LIB_ODBC_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS) $(EXTRALIBS_GUI)
        $(__minimal___mac_rezcmd)
        $(__minimal___mac_setfilecmd)
+       $(SAMPLES_RPATH_POSTLINK)
 
 minimal_minimal.o: $(srcdir)/minimal.cpp
        $(CXXC) -c -o $@ $(MINIMAL_CXXFLAGS) $<
 
 minimal_minimal.o: $(srcdir)/minimal.cpp
        $(CXXC) -c -o $@ $(MINIMAL_CXXFLAGS) $<