diff --git a/build/bakefiles/common_samples.bkl b/build/bakefiles/common_samples.bkl
index 892a3b867a..735f3f64a1 100644
--- a/build/bakefiles/common_samples.bkl
+++ b/build/bakefiles/common_samples.bkl
@@ -39,10 +39,16 @@
- $(SAMPLES_RPATH_FLAG)
+
+ $(SAMPLES_RPATH_FLAG)
+ <__command>$(LF)$(SAMPLES_RPATH_POSTLINK)
+
- $(SAMPLES_RPATH_FLAG)
+
+ $(SAMPLES_RPATH_FLAG)
+ <__command>$(SAMPLES_RPATH_POSTLINK)
+
diff --git a/build/bakefiles/config.bkl b/build/bakefiles/config.bkl
index 28e94c95d1..9e2d2e887a 100644
--- a/build/bakefiles/config.bkl
+++ b/build/bakefiles/config.bkl
@@ -168,8 +168,9 @@ compiled .lib files and setup.h under the lib/ toplevel directory.
-
+
+
$(top_srcdir)/
dynamic
@@ -197,7 +198,6 @@ it if SHARED=1 unless you know what you are doing.
MSW
$(TOOLKIT.lower())
-
diff --git a/configure b/configure
index 7b021e92bd..7aa4668370 100755
--- 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"
- 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
@@ -25460,12 +25452,17 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
;;
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 <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
diff --git a/configure.in b/configure.in
index ae9be08ae7..7677c204e9 100644
--- a/configure.in
+++ b/configure.in
@@ -140,6 +140,7 @@ DEFAULT_DEFAULT_wxUSE_X11=0
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"
@@ -3105,7 +3106,6 @@ if test "$wxUSE_SHARED" = "yes"; then
case "${host}" in
*-*-linux* | *-*-gnu* )
SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(top_builddir)lib"
- ;;
*-*-solaris2* )
if test "$GCC" = yes ; then
@@ -3144,6 +3144,21 @@ if test "$wxUSE_SHARED" = "yes"; then
SAMPLES_RPATH_FLAG="-R\$(top_builddir)lib"
fi
;;
+
+ powerpc-*-darwin* )
+ SAMPLES_RPATH_POSTLINK="\$(top_builddir)change-install-names \$(LIBDIRNAME) \$(prefix) \$@"
+ cat <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
@@ -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(SAMPLES_RPATH_POSTLINK)
AC_SUBST(HOST_SUFFIX)
AC_BAKEFILE
diff --git a/samples/minimal/Makefile.in b/samples/minimal/Makefile.in
index 90506f04f1..0d3f775a7f 100644
--- a/samples/minimal/Makefile.in
+++ b/samples/minimal/Makefile.in
@@ -21,6 +21,7 @@ LDFLAGS = @LDFLAGS@
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@
@@ -130,13 +131,12 @@ COND_PLATFORM_MAC_1___minimal___mac_rezcmd = $(RESCOMP) -d __DARWIN__ -t APPL -d
all: minimal$(EXEEXT)
clean:
- rm -rf ./.deps
+ rm -rf ./.deps ./.pch
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
@@ -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)
+ $(SAMPLES_RPATH_POSTLINK)
minimal_minimal.o: $(srcdir)/minimal.cpp
$(CXXC) -c -o $@ $(MINIMAL_CXXFLAGS) $<