Check if linker supports scripts for versioning

Use ld's option --version-script where available and fall back
to plain symbol file otherwise. This check uses the m4 macro
AX_CHECK_LINK_FLAG <http://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html>
This commit is contained in:
Olaf Bergmann committed 2015-03-03 19:21:44 +01:00
1 parent e3f555f396
commit 489df85c88
2 files changed
+9 -3

No files matched your search

+3 -3
View File
@@ -87,9 +87,9 @@ libcoap_include_HEADERS = \
## Instruct libtool to include API version information in the generated shared
## library file (.so). The library ABI version will later defined in configure.ac,
## so that all version information is kept in one place.
libcoap_@LIBCOAP_API_VERSION@_la_LDFLAGS = \
-version-info $(LT_LIBCOAP_CURRENT):$(LT_LIBCOAP_REVISION):$(LT_LIBCOAP_AGE) \
-Wl,--version-script=$(srcdir)/libcoap-$(LIBCOAP_API_VERSION).map \
libcoap_@LIBCOAP_API_VERSION@_la_LDFLAGS = \
-version-info $(LT_LIBCOAP_CURRENT):$(LT_LIBCOAP_REVISION):$(LT_LIBCOAP_AGE) \
@libcoap_SYMBOLS@ \
-pie
# This helper is called by libcoap-$(LIBCOAP_API_VERSION).{map,sym} to see if
+6
View File
@@ -118,6 +118,12 @@ AX_CHECK_COMPILE_FLAG([-fdiagnostics-color], [CFLAGS="$CFLAGS -fdiagnostics-colo
AC_SUBST([WARNING_CFLAGS])
AX_CHECK_LINK_FLAG([-Wl,--version-script=./libcoap-${LIBCOAP_API_VERSION}.map],
[libcoap_SYMBOLS="-Wl,--version-script=\$(srcdir)/libcoap-\$(LIBCOAP_API_VERSION).map"],
[libcoap_SYMBOLS="-export-symbols \$(srcdir)/libcoap-\$(LIBCOAP_API_VERSION).sym"])
AC_SUBST(libcoap_SYMBOLS)
# configure options
# __documentation__
AC_ARG_ENABLE([documentation],