summaryrefslogtreecommitdiff
path: root/lib/glm4
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2009-03-04 15:25:13 +0100
committerSimon Josefsson <simon@josefsson.org>2009-03-04 15:25:13 +0100
commite06297f5dced46aafc3deac1805929acd4d9ce02 (patch)
tree01e3871eac5783154e77c2d3ae814abb56c556ff /lib/glm4
parentf6b9ec0b58fb3bd81818536fe8dbeeb522112760 (diff)
downloadlibtasn1-e06297f5dced46aafc3deac1805929acd4d9ce02.tar.gz
libtasn1-e06297f5dced46aafc3deac1805929acd4d9ce02.tar.bz2
libtasn1-e06297f5dced46aafc3deac1805929acd4d9ce02.zip
Use linker script test from gnulib.
Diffstat (limited to 'lib/glm4')
-rw-r--r--lib/glm4/gnulib-cache.m43
-rw-r--r--lib/glm4/gnulib-comp.m42
-rw-r--r--lib/glm4/ld-version-script.m439
3 files changed, 43 insertions, 1 deletions
diff --git a/lib/glm4/gnulib-cache.m4 b/lib/glm4/gnulib-cache.m4
index 989a099..3c1d474 100644
--- a/lib/glm4/gnulib-cache.m4
+++ b/lib/glm4/gnulib-cache.m4
@@ -15,11 +15,12 @@
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib/gllib --m4-base=lib/glm4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=dummy --lgpl=2 --libtool --macro-prefix=lgl --no-vc-files stdint
+# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib/gllib --m4-base=lib/glm4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=dummy --lgpl=2 --libtool --macro-prefix=lgl --no-vc-files ld-version-script stdint
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([])
gl_MODULES([
+ ld-version-script
stdint
])
gl_AVOID([dummy])
diff --git a/lib/glm4/gnulib-comp.m4 b/lib/glm4/gnulib-comp.m4
index 4cb45d8..435a364 100644
--- a/lib/glm4/gnulib-comp.m4
+++ b/lib/glm4/gnulib-comp.m4
@@ -40,6 +40,7 @@ AC_DEFUN([lgl_INIT],
m4_pushdef([lgl_LIBSOURCES_DIR], [])
gl_COMMON
gl_source_base='lib/gllib'
+ gl_LD_VERSION_SCRIPT
AC_REQUIRE([gl_MULTIARCH])
gl_STDINT_H
gl_WCHAR_H
@@ -177,6 +178,7 @@ AC_DEFUN([lgl_FILE_LIST], [
m4/00gnulib.m4
m4/gnulib-common.m4
m4/include_next.m4
+ m4/ld-version-script.m4
m4/longlong.m4
m4/multiarch.m4
m4/stdint.m4
diff --git a/lib/glm4/ld-version-script.m4 b/lib/glm4/ld-version-script.m4
new file mode 100644
index 0000000..e321347
--- /dev/null
+++ b/lib/glm4/ld-version-script.m4
@@ -0,0 +1,39 @@
+# 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
+
+# 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")
+])