summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2009-04-03 15:00:27 +0200
committerSimon Josefsson <simon@josefsson.org>2009-04-03 15:00:27 +0200
commitcd4a00d469912cc14c47671df0fed24586e6d26e (patch)
tree84abf242a3f839306dae74ed6ec20235665219cf
parente54590c7c17384329e6ccd870344c1258929d098 (diff)
downloadgnutls-cd4a00d469912cc14c47671df0fed24586e6d26e.tar.gz
Use linker-script from gnulib.
-rw-r--r--configure.ac1
-rw-r--r--gl/Makefile.am2
-rw-r--r--gl/m4/gnulib-cache.m43
-rw-r--r--gl/m4/gnulib-comp.m42
-rw-r--r--gl/m4/ld-version-script.m444
-rw-r--r--m4/linker-script.m430
6 files changed, 49 insertions, 33 deletions
diff --git a/configure.ac b/configure.ac
index a53df46712..92c86e6ec0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,7 +80,6 @@ AC_DEFINE([HAVE_ERRNO_H], 1, [Hard-code for src/cfg/.])
AM_CONDITIONAL(HAVE_FORK, test "$ac_cv_func_fork" != "no")
sj_VALGRIND
-sj_LINKER_SCRIPT([$srcdir/lib/libgnutls.map])
AC_CHECK_TYPES(uint,,, [
# include <sys/types.h>
diff --git a/gl/Makefile.am b/gl/Makefile.am
index ce147e038d..69d8b33f4c 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -9,7 +9,7 @@
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --libtool --macro-prefix=gl --no-vc-files accept arpa_inet autobuild bind close connect error fdl-1.3 gendocs getaddrinfo getline getpass-gnu gnupload gpl-3.0 inet_ntop inet_pton lgpl-2.1 lib-msvc-compat listen maintainer-makefile manywarnings minmax perror pmccabe2html progname read-file readline recv select send setsockopt shutdown socket sys_stat version-etc-fsf warnings
+# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --libtool --macro-prefix=gl --no-vc-files accept arpa_inet autobuild bind close connect error fdl-1.3 gendocs getaddrinfo getline getpass-gnu gnupload gpl-3.0 inet_ntop inet_pton lgpl-2.1 lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings minmax perror pmccabe2html progname read-file readline recv select send setsockopt shutdown socket sys_stat version-etc-fsf warnings
AUTOMAKE_OPTIONS = 1.5 gnits
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
index f97083119b..235b9498e6 100644
--- a/gl/m4/gnulib-cache.m4
+++ b/gl/m4/gnulib-cache.m4
@@ -15,7 +15,7 @@
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --libtool --macro-prefix=gl --no-vc-files accept arpa_inet autobuild bind close connect error fdl-1.3 gendocs getaddrinfo getline getpass-gnu gnupload gpl-3.0 inet_ntop inet_pton lgpl-2.1 lib-msvc-compat listen maintainer-makefile manywarnings minmax perror pmccabe2html progname read-file readline recv select send setsockopt shutdown socket sys_stat version-etc-fsf warnings
+# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --libtool --macro-prefix=gl --no-vc-files accept arpa_inet autobuild bind close connect error fdl-1.3 gendocs getaddrinfo getline getpass-gnu gnupload gpl-3.0 inet_ntop inet_pton lgpl-2.1 lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings minmax perror pmccabe2html progname read-file readline recv select send setsockopt shutdown socket sys_stat version-etc-fsf warnings
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([gl/override])
@@ -38,6 +38,7 @@ gl_MODULES([
inet_pton
lgpl-2.1
lib-msvc-compat
+ lib-symbol-versions
listen
maintainer-makefile
manywarnings
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index bd06b134fa..e8e36322c1 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -107,6 +107,7 @@ AC_SUBST([LTALLOCA])
gl_INET_PTON
gl_ARPA_INET_MODULE_INDICATOR([inet_pton])
gl_LD_OUTPUT_DEF
+ gl_LD_VERSION_SCRIPT
AC_REQUIRE([gl_HEADER_SYS_SOCKET])
if test "$ac_cv_header_winsock2_h" = yes; then
AC_LIBOBJ([listen])
@@ -435,6 +436,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/intmax_t.m4
m4/inttypes_h.m4
m4/ld-output-def.m4
+ m4/ld-version-script.m4
m4/lib-ld.m4
m4/lib-link.m4
m4/lib-prefix.m4
diff --git a/gl/m4/ld-version-script.m4 b/gl/m4/ld-version-script.m4
new file mode 100644
index 0000000000..a97888f249
--- /dev/null
+++ b/gl/m4/ld-version-script.m4
@@ -0,0 +1,44 @@
+# ld-version-script.m4 serial 1
+dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Simon Josefsson
+
+# FIXME: The test below returns a false positive for mingw
+# cross-compiles, 'local:' statements does not reduce number of
+# exported symbols in a DLL. Use --disable-ld-version-script to work
+# around the problem.
+
+# gl_LD_VERSION_SCRIPT
+# --------------------
+# Check if LD supports linker scripts, and define automake conditional
+# HAVE_LD_VERSION_SCRIPT if so.
+AC_DEFUN([gl_LD_VERSION_SCRIPT],
+[
+ AC_ARG_ENABLE([ld-version-script],
+ AS_HELP_STRING([--enable-ld-version-script],
+ [enable linker version script (default is enabled when possible)]),
+ [have_ld_version_script=$enableval], [])
+ if test -z "$have_ld_version_script"; then
+ AC_MSG_CHECKING([if LD -Wl,--version-script works])
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
+ cat > conftest.map <<EOF
+VERS_1 {
+ global: sym;
+};
+
+VERS_2 {
+ global: sym;
+} VERS_1;
+EOF
+ AC_LINK_IFELSE(AC_LANG_PROGRAM([], []),
+ [have_ld_version_script=yes], [have_ld_version_script=no])
+ rm -f conftest.map
+ LDFLAGS="$save_LDFLAGS"
+ AC_MSG_RESULT($have_ld_version_script)
+ fi
+ AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
+])
diff --git a/m4/linker-script.m4 b/m4/linker-script.m4
deleted file mode 100644
index 7570a942a2..0000000000
--- a/m4/linker-script.m4
+++ /dev/null
@@ -1,30 +0,0 @@
-# linker-script.m4 serial 1
-dnl Copyright (C) 2008 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Simon Josefsson
-
-# sj_LINKER_SCRIPT(VERSION-SCRIPT)
-# -------------
-# Check if ld supports linker scripts, and define automake conditional
-# HAVE_LD_VERSION_SCRIPT if so. VERSION-SCRIPT is a valid version script
-# file.
-AC_DEFUN([sj_LINKER_SCRIPT],
-[
- AC_ARG_ENABLE([ld-version-script],
- AS_HELP_STRING([--enable-ld-version-script],
- [enable/disable linker version script (default is enabled when possible)]),
- [have_ld_version_script=$enableval], [])
- if test -z "$have_ld_version_script"; then
- AC_MSG_CHECKING([if -Wl,--version-script works])
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -Wl,--version-script=$1"
- AC_LINK_IFELSE(AC_LANG_PROGRAM([], []),
- [have_ld_version_script=yes], [have_ld_version_script=no])
- LDFLAGS="$save_LDFLAGS"
- AC_MSG_RESULT($have_ld_version_script)
- fi
- AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
-])