added support for versioned symbols on Linux
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17668 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
51
acinclude.m4
51
acinclude.m4
@@ -382,6 +382,57 @@ AC_DEFUN([WX_ARG_ENABLE],
|
||||
])
|
||||
|
||||
|
||||
dnl ===========================================================================
|
||||
dnl Linker features test
|
||||
dnl ===========================================================================
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl WX_VERSIONED_SYMBOLS checks whether the linker can create versioned
|
||||
dnl symbols. If it can, sets LDFLAGS_VERSIONING to $CXX flags needed to use
|
||||
dnl version script file named versionfile
|
||||
dnl
|
||||
dnl call WX_VERSIONED_SYMBOLS(versionfile)
|
||||
dnl ---------------------------------------------------------------------------
|
||||
AC_DEFUN([WX_VERSIONED_SYMBOLS],
|
||||
[
|
||||
found_versioning=no
|
||||
|
||||
dnl Check for known non-gcc cases:
|
||||
case "${host}" in
|
||||
*-*-solaris2* )
|
||||
if test "x$GCC" != "xyes" ; then
|
||||
LDFLAGS_VERSIONING="-M $1"
|
||||
found_versioning=yes
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl Generic check for GCC or GCC-like behaviour (Intel C++, GCC):
|
||||
if test $found_versioning = no ; then
|
||||
AC_CACHE_CHECK([if the linker accepts --version-script], wx_cv_version_script,
|
||||
[
|
||||
echo "VER_1 { *; };" >conftest.sym
|
||||
echo "int main() { return 0; }" >conftest.cpp
|
||||
|
||||
if AC_TRY_COMMAND([
|
||||
$CXX -o conftest.output $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.cpp
|
||||
-Wl,--version-script,conftest.sym >/dev/null 2>conftest.stderr]) ; then
|
||||
if test -s conftest.stderr ; then
|
||||
wx_cv_version_script=no
|
||||
else
|
||||
wx_cv_version_script=yes
|
||||
fi
|
||||
else
|
||||
wx_cv_version_script=no
|
||||
fi
|
||||
rm -f conftest.output conftest.stderr conftest.sym conftest.cpp
|
||||
])
|
||||
if test $wx_cv_version_script = yes ; then
|
||||
LDFLAGS_VERSIONING="-Wl,--version-script,$1"
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl ===========================================================================
|
||||
dnl "3rd party" macros included here because they are not widely available
|
||||
|
171
aclocal.m4
vendored
171
aclocal.m4
vendored
@@ -353,6 +353,10 @@ AC_DEFUN([WX_ARG_WITH],
|
||||
|
||||
dnl like WX_ARG_WITH but uses AC_ARG_ENABLE instead of AC_ARG_WITH
|
||||
dnl usage: WX_ARG_ENABLE(option, helpmessage, variable-name, enablestring)
|
||||
dnl
|
||||
dnl enablestring is a hack and allows to show "checking for --disable-foo"
|
||||
dnl message when running configure instead of the default "checking for
|
||||
dnl --enable-foo" one whih is useful for the options enabled by default
|
||||
AC_DEFUN([WX_ARG_ENABLE],
|
||||
[
|
||||
enablestring=$4
|
||||
@@ -390,6 +394,57 @@ AC_DEFUN([WX_ARG_ENABLE],
|
||||
])
|
||||
|
||||
|
||||
dnl ===========================================================================
|
||||
dnl Linker features test
|
||||
dnl ===========================================================================
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl WX_VERSIONED_SYMBOLS checks whether the linker can create versioned
|
||||
dnl symbols. If it can, sets LDFLAGS_VERSIONING to $CXX flags needed to use
|
||||
dnl version script file named versionfile
|
||||
dnl
|
||||
dnl call WX_VERSIONED_SYMBOLS(versionfile)
|
||||
dnl ---------------------------------------------------------------------------
|
||||
AC_DEFUN([WX_VERSIONED_SYMBOLS],
|
||||
[
|
||||
found_versioning=no
|
||||
|
||||
dnl Check for known non-gcc cases:
|
||||
case "${host}" in
|
||||
*-*-solaris2* )
|
||||
if test "x$GCC" != "xyes" ; then
|
||||
LDFLAGS_VERSIONING="-M $1"
|
||||
found_versioning=yes
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl Generic check for GCC or GCC-like behaviour (Intel C++, GCC):
|
||||
if test $found_versioning = no ; then
|
||||
AC_CACHE_CHECK([if the linker accepts --version-script], wx_cv_version_script,
|
||||
[
|
||||
echo "VER_1 { *; };" >conftest.sym
|
||||
echo "int main() { return 0; }" >conftest.cpp
|
||||
|
||||
if AC_TRY_COMMAND([
|
||||
$CXX -o conftest.output $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.cpp
|
||||
-Wl,--version-script,conftest.sym >/dev/null 2>conftest.stderr]) ; then
|
||||
if test -s conftest.stderr ; then
|
||||
wx_cv_version_script=no
|
||||
else
|
||||
wx_cv_version_script=yes
|
||||
fi
|
||||
else
|
||||
wx_cv_version_script=no
|
||||
fi
|
||||
rm -f conftest.output conftest.stderr conftest.sym conftest.cpp
|
||||
])
|
||||
if test $wx_cv_version_script = yes ; then
|
||||
LDFLAGS_VERSIONING="-Wl,--version-script,$1"
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl ===========================================================================
|
||||
dnl "3rd party" macros included here because they are not widely available
|
||||
@@ -733,64 +788,6 @@ main ()
|
||||
rm -f conf.gtktest
|
||||
])
|
||||
|
||||
|
||||
dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
|
||||
dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
|
||||
dnl also defines GSTUFF_PKG_ERRORS on error
|
||||
AC_DEFUN(PKG_CHECK_MODULES, [
|
||||
succeeded=no
|
||||
|
||||
if test -z "$PKG_CONFIG"; then
|
||||
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
fi
|
||||
|
||||
if test "$PKG_CONFIG" = "no" ; then
|
||||
echo "*** The pkg-config script could not be found. Make sure it is"
|
||||
echo "*** in your path, or set the PKG_CONFIG environment variable"
|
||||
echo "*** to the full path to pkg-config."
|
||||
echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
|
||||
else
|
||||
PKG_CONFIG_MIN_VERSION=0.9.0
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
|
||||
AC_MSG_CHECKING(for $2)
|
||||
|
||||
if $PKG_CONFIG --exists "$2" ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
succeeded=yes
|
||||
|
||||
AC_MSG_CHECKING($1_CFLAGS)
|
||||
$1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
|
||||
AC_MSG_RESULT($$1_CFLAGS)
|
||||
|
||||
AC_MSG_CHECKING($1_LIBS)
|
||||
$1_LIBS=`$PKG_CONFIG --libs "$2"`
|
||||
AC_MSG_RESULT($$1_LIBS)
|
||||
else
|
||||
$1_CFLAGS=""
|
||||
$1_LIBS=""
|
||||
## If we have a custom action on failure, don't print errors, but
|
||||
## do set a variable so people can do so.
|
||||
$1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
|
||||
ifelse([$4], ,echo $$1_PKG_ERRORS,)
|
||||
fi
|
||||
|
||||
AC_SUBST($1_CFLAGS)
|
||||
AC_SUBST($1_LIBS)
|
||||
else
|
||||
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
|
||||
echo "*** See http://www.freedesktop.org/software/pkgconfig"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $succeeded = yes; then
|
||||
ifelse([$3], , :, [$3])
|
||||
else
|
||||
ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
|
||||
# Configure paths for GTK+
|
||||
# Owen Taylor 97-11-3
|
||||
|
||||
@@ -986,3 +983,61 @@ main ()
|
||||
rm -f conf.gtktest
|
||||
])
|
||||
|
||||
|
||||
dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
|
||||
dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
|
||||
dnl also defines GSTUFF_PKG_ERRORS on error
|
||||
AC_DEFUN(PKG_CHECK_MODULES, [
|
||||
succeeded=no
|
||||
|
||||
if test -z "$PKG_CONFIG"; then
|
||||
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
fi
|
||||
|
||||
if test "$PKG_CONFIG" = "no" ; then
|
||||
echo "*** The pkg-config script could not be found. Make sure it is"
|
||||
echo "*** in your path, or set the PKG_CONFIG environment variable"
|
||||
echo "*** to the full path to pkg-config."
|
||||
echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
|
||||
else
|
||||
PKG_CONFIG_MIN_VERSION=0.9.0
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
|
||||
AC_MSG_CHECKING(for $2)
|
||||
|
||||
if $PKG_CONFIG --exists "$2" ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
succeeded=yes
|
||||
|
||||
AC_MSG_CHECKING($1_CFLAGS)
|
||||
$1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
|
||||
AC_MSG_RESULT($$1_CFLAGS)
|
||||
|
||||
AC_MSG_CHECKING($1_LIBS)
|
||||
$1_LIBS=`$PKG_CONFIG --libs "$2"`
|
||||
AC_MSG_RESULT($$1_LIBS)
|
||||
else
|
||||
$1_CFLAGS=""
|
||||
$1_LIBS=""
|
||||
## If we have a custom action on failure, don't print errors, but
|
||||
## do set a variable so people can do so.
|
||||
$1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
|
||||
ifelse([$4], ,echo $$1_PKG_ERRORS,)
|
||||
fi
|
||||
|
||||
AC_SUBST($1_CFLAGS)
|
||||
AC_SUBST($1_LIBS)
|
||||
else
|
||||
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
|
||||
echo "*** See http://www.freedesktop.org/software/pkgconfig"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $succeeded = yes; then
|
||||
ifelse([$3], , :, [$3])
|
||||
else
|
||||
ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
|
||||
|
22
configure.in
22
configure.in
@@ -2590,6 +2590,8 @@ if test "$wxUSE_DEBUG_FLAG" = "yes"; then
|
||||
lib_debug_suffix=d
|
||||
fi
|
||||
|
||||
WX_VERSION_TAG=`echo WX${TOOLKIT_DIR}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}_${WX_RELEASE} | tr "[[a-z]]" "[[A-Z]]"`
|
||||
|
||||
TOOLCHAIN_NAME="${TOOLKIT_DIR}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}-${WX_RELEASE}"
|
||||
TOOLCHAIN_NAME_GL="${TOOLKIT_DIR}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}_gl-${WX_RELEASE}"
|
||||
|
||||
@@ -2688,20 +2690,24 @@ if test "$wxUSE_SHARED" = "yes"; then
|
||||
PIC_FLAG="-fPIC"
|
||||
fi
|
||||
|
||||
|
||||
dnl use versioned symbols if available on the platform
|
||||
WX_VERSIONED_SYMBOLS([\$(top_builddir)/version-script])
|
||||
|
||||
dnl the command to use for creating the shared library
|
||||
SHARED_LD="${CXX} -shared -o"
|
||||
SHARED_LD="${CXX} -shared $LDFLAGS_VERSIONING -o"
|
||||
|
||||
case "${host}" in
|
||||
*-hp-hpux* )
|
||||
dnl default settings are good for gcc but not for the native HP-UX
|
||||
if test "$GCC" = "yes"; then
|
||||
dnl -o flag must be after PIC flag
|
||||
SHARED_LD="${CXX} -shared ${PIC_FLAG} -o"
|
||||
SHARED_LD="${CXX} -shared ${PIC_FLAG} $LDFLAGS_VERSIONING -o"
|
||||
else
|
||||
dnl no idea why it wants it, but it does
|
||||
LDFLAGS="$LDFLAGS -L/usr/lib"
|
||||
|
||||
SHARED_LD="${CXX} -b -o"
|
||||
SHARED_LD="${CXX} -b $LDFLAGS_VERSIONING -o"
|
||||
PIC_FLAG="+Z"
|
||||
fi
|
||||
|
||||
@@ -2747,7 +2753,7 @@ if test "$wxUSE_SHARED" = "yes"; then
|
||||
dnl Solaris (which use old style C syntax)
|
||||
CPPFLAGS="$CPPFLAGS -isystem /usr/openwin/include"
|
||||
else
|
||||
SHARED_LD="${CXX} -G -o"
|
||||
SHARED_LD="${CXX} -G $LDFLAGS_VERSIONING -o"
|
||||
PIC_FLAG="-KPIC"
|
||||
SONAME_FLAGS="-h ${WX_LIBRARY_NAME_SHARED}"
|
||||
SONAME_FLAGS_GL="-h ${WX_LIBRARY_NAME_SHARED_GL}"
|
||||
@@ -2764,7 +2770,7 @@ if test "$wxUSE_SHARED" = "yes"; then
|
||||
dnl this can be done either with the exe linker flag -Wl,-bind_at_load
|
||||
dnl or with a double stage link in order to create a single module
|
||||
dnl "-init _wxWindowsDylibInit" not useful with lazy linking solved
|
||||
SHARED_LD="\${top_srcdir}/distrib/mac/shared-ld-sh -undefined suppress -flat_namespace -o"
|
||||
SHARED_LD="\${top_srcdir}/distrib/mac/shared-ld-sh -undefined suppress -flat_namespace $LDFLAGS_VERSIONING -o"
|
||||
PIC_FLAG="-dynamic -fPIC"
|
||||
SONAME_FLAGS="-compatibility_version ${WX_RELEASE} -current_version ${WX_VERSION}"
|
||||
SONAME_FLAGS_GL=${SONAME_FLAGS}
|
||||
@@ -2778,7 +2784,7 @@ if test "$wxUSE_SHARED" = "yes"; then
|
||||
AC_CHECK_PROG(AIX_CXX_LD, makeC++SharedLib,
|
||||
makeC++SharedLib, /usr/lpp/xlC/bin/makeC++SharedLib)
|
||||
|
||||
SHARED_LD="$(AIX_CXX_LD) -p 0 -o"
|
||||
SHARED_LD="$(AIX_CXX_LD) -p 0 $LDFLAGS_VERSIONING -o"
|
||||
fi
|
||||
;;
|
||||
|
||||
@@ -2802,7 +2808,7 @@ if test "$wxUSE_SHARED" = "yes"; then
|
||||
*-*-beos* )
|
||||
dnl can't use gcc under BeOS for shared library creation because it
|
||||
dnl complains about missing 'main'
|
||||
SHARED_LD="${LD} -shared -o"
|
||||
SHARED_LD="${LD} -shared $LDFLAGS_VERSIONING -o"
|
||||
;;
|
||||
|
||||
*-*-irix* )
|
||||
@@ -5197,6 +5203,7 @@ AC_SUBST(LDFLAGS_EXE)
|
||||
AC_SUBST(OPENGL_LIBS)
|
||||
AC_SUBST(DMALLOC_LIBS)
|
||||
AC_SUBST(EXTRADEFS)
|
||||
AC_SUBST(WX_VERSION_TAG)
|
||||
|
||||
dnl additional resurces settings
|
||||
AC_SUBST(RESCOMP)
|
||||
@@ -5262,6 +5269,7 @@ dnl (the original file name may be overriden by appending another name after a
|
||||
dnl colon)
|
||||
AC_OUTPUT([
|
||||
wx-config
|
||||
version-script
|
||||
src/make.env
|
||||
src/makeprog.env
|
||||
src/makelib.env
|
||||
|
@@ -183,6 +183,7 @@ Unix (Base/GUI):
|
||||
|
||||
- minor OpenBSD compilation/linking fixes, now builds OOB under OpenBSD 3.1
|
||||
- don't include -I/usr/include nor -I/usr/local/include in wx-config output
|
||||
- shared library symbols are now versioned on platforms that support it (Linux)
|
||||
|
||||
wxMSW:
|
||||
|
||||
|
3
version-script.in
Normal file
3
version-script.in
Normal file
@@ -0,0 +1,3 @@
|
||||
@WX_VERSION_TAG@ {
|
||||
*;
|
||||
};
|
Reference in New Issue
Block a user