use install_name_tool so that samples use uninstalled shared libs on OSX
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22742 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -39,10 +39,16 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template id="wx_sample" template="wx_util">
|
<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>
|
||||||
<template id="wx_sample_console" template="wx_util_console">
|
<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>
|
||||||
|
|
||||||
|
|
||||||
|
@@ -168,8 +168,9 @@ compiled .lib files and setup.h under the lib/ toplevel directory.
|
|||||||
<option name="EXTRALIBS_ODBC"/>
|
<option name="EXTRALIBS_ODBC"/>
|
||||||
<option name="EXTRALIBS_GUI"/>
|
<option name="EXTRALIBS_GUI"/>
|
||||||
<option name="EXTRALIBS_OPENGL"/>
|
<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="TOP_SRCDIR">$(top_srcdir)/</set>
|
||||||
<set var="RUNTIME_LIBS">dynamic</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">MSW</set>
|
||||||
<set var="TOOLKIT_LOWERCASE">$(TOOLKIT.lower())</set>
|
<set var="TOOLKIT_LOWERCASE">$(TOOLKIT.lower())</set>
|
||||||
<set var="TOOLKIT_VERSION"/>
|
<set var="TOOLKIT_VERSION"/>
|
||||||
<set var="SAMPLES_RPATH_FLAG"/>
|
|
||||||
<set var="HOST_SUFFIX"/>
|
<set var="HOST_SUFFIX"/>
|
||||||
<set var="EXTRALIBS"/>
|
<set var="EXTRALIBS"/>
|
||||||
<set var="EXTRALIBS_XML"/>
|
<set var="EXTRALIBS_XML"/>
|
||||||
|
25
configure
vendored
25
configure
vendored
@@ -25346,14 +25346,6 @@ echo "${ECHO_T}$wx_cv_version_script" >&6
|
|||||||
case "${host}" in
|
case "${host}" in
|
||||||
*-*-linux* | *-*-gnu* )
|
*-*-linux* | *-*-gnu* )
|
||||||
SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(top_builddir)lib"
|
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* )
|
*-*-solaris2* )
|
||||||
if test "$GCC" = yes ; then
|
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*\$'\` ; \\
|
SAMPLES_RPATH_POSTLINK="\$(top_builddir)change-install-names \$(LIBDIRNAME) \$(prefix) \$@"
|
||||||
inst_cmd='install_name_tool ' ; \\
|
cat <<EOF >change-install-names
|
||||||
for i in \$libnames ; do \\
|
#!/bin/sh
|
||||||
inst_cmd=\"\$inst_cmd -change \$(prefix)/lib/\\$i \$(LIBDIRNAME)/\\$i\" ; \\
|
libnames=\`cd \${1} ; ls -1 | grep '\.[0-9][0-9]*\.dylib\$'\`
|
||||||
done ; \\
|
inst_cmd="install_name_tool "
|
||||||
echo \$inst_cmd "
|
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
|
||||||
|
18
configure.in
18
configure.in
@@ -140,6 +140,7 @@ DEFAULT_DEFAULT_wxUSE_X11=0
|
|||||||
PROGRAM_EXT=
|
PROGRAM_EXT=
|
||||||
SO_SUFFIX=so
|
SO_SUFFIX=so
|
||||||
SAMPLES_RPATH_FLAG=
|
SAMPLES_RPATH_FLAG=
|
||||||
|
SAMPLES_RPATH_POSTLINK=
|
||||||
|
|
||||||
dnl to support a new system, you need to add its canonical name (as determined
|
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 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
|
case "${host}" in
|
||||||
*-*-linux* | *-*-gnu* )
|
*-*-linux* | *-*-gnu* )
|
||||||
SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(top_builddir)lib"
|
SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(top_builddir)lib"
|
||||||
;;
|
|
||||||
|
|
||||||
*-*-solaris2* )
|
*-*-solaris2* )
|
||||||
if test "$GCC" = yes ; then
|
if test "$GCC" = yes ; then
|
||||||
@@ -3144,6 +3144,21 @@ if test "$wxUSE_SHARED" = "yes"; then
|
|||||||
SAMPLES_RPATH_FLAG="-R\$(top_builddir)lib"
|
SAMPLES_RPATH_FLAG="-R\$(top_builddir)lib"
|
||||||
fi
|
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
|
esac
|
||||||
|
|
||||||
dnl set target to shared if not explicitly chose static before
|
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_LOWERCASE)
|
||||||
AC_SUBST(TOOLKIT_VERSION)
|
AC_SUBST(TOOLKIT_VERSION)
|
||||||
AC_SUBST(SAMPLES_RPATH_FLAG)
|
AC_SUBST(SAMPLES_RPATH_FLAG)
|
||||||
|
AC_SUBST(SAMPLES_RPATH_POSTLINK)
|
||||||
AC_SUBST(HOST_SUFFIX)
|
AC_SUBST(HOST_SUFFIX)
|
||||||
|
|
||||||
AC_BAKEFILE
|
AC_BAKEFILE
|
||||||
|
@@ -21,6 +21,7 @@ LDFLAGS = @LDFLAGS@
|
|||||||
LDFLAGS_GUI = @LDFLAGS_GUI@
|
LDFLAGS_GUI = @LDFLAGS_GUI@
|
||||||
RESCOMP = @RESCOMP@
|
RESCOMP = @RESCOMP@
|
||||||
SAMPLES_RPATH_FLAG = @SAMPLES_RPATH_FLAG@
|
SAMPLES_RPATH_FLAG = @SAMPLES_RPATH_FLAG@
|
||||||
|
SAMPLES_RPATH_POSTLINK = @SAMPLES_RPATH_POSTLINK@
|
||||||
SETFILE = @SETFILE@
|
SETFILE = @SETFILE@
|
||||||
TOOLCHAIN_NAME = @TOOLCHAIN_NAME@
|
TOOLCHAIN_NAME = @TOOLCHAIN_NAME@
|
||||||
TOOLKIT = @TOOLKIT@
|
TOOLKIT = @TOOLKIT@
|
||||||
@@ -130,13 +131,12 @@ COND_PLATFORM_MAC_1___minimal___mac_rezcmd = $(RESCOMP) -d __DARWIN__ -t APPL -d
|
|||||||
all: minimal$(EXEEXT)
|
all: minimal$(EXEEXT)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf ./.deps
|
rm -rf ./.deps ./.pch
|
||||||
rm -f ./*.o
|
rm -f ./*.o
|
||||||
rm -f minimal$(EXEEXT)
|
rm -f minimal$(EXEEXT)
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
rm -f configure config.cache config.log config.status
|
rm -f configure config.cache config.log config.status bk-deps bk-make-pch shared-ld-sh Makefile
|
||||||
rm -f bk-deps shared-ld-sh
|
|
||||||
|
|
||||||
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)
|
$(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_rezcmd)
|
||||||
$(__minimal___mac_setfilecmd)
|
$(__minimal___mac_setfilecmd)
|
||||||
|
$(SAMPLES_RPATH_POSTLINK)
|
||||||
|
|
||||||
minimal_minimal.o: $(srcdir)/minimal.cpp
|
minimal_minimal.o: $(srcdir)/minimal.cpp
|
||||||
$(CXXC) -c -o $@ $(MINIMAL_CXXFLAGS) $<
|
$(CXXC) -c -o $@ $(MINIMAL_CXXFLAGS) $<
|
||||||
|
Reference in New Issue
Block a user