Commit 3d6b6ead authored by Guillem Jover's avatar Guillem Jover

build: Detect support for --version-script in ld

parent eb445425
...@@ -27,6 +27,25 @@ AC_SYS_LARGEFILE ...@@ -27,6 +27,25 @@ AC_SYS_LARGEFILE
LT_INIT LT_INIT
AC_CACHE_CHECK([if ld supports --version-script flag],
[libbsd_cv_version_script], [
echo "{ global: symbol; local: *; };" >conftest.map
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
AC_LINK_IFELSE([
AC_LANG_PROGRAM([], [])
], [
libbsd_cv_version_script=yes
], [
libbsd_cv_version_script=no
])
LDFLAGS="$save_LDFLAGS"
rm -f conftest.map
]
)
AM_CONDITIONAL([HAVE_LINKER_VERSION_SCRIPT],
[test "x$libbsd_cv_version_script" = "xyes"])
# Checks for programs. # Checks for programs.
AC_PROG_CC AC_PROG_CC
AC_PROG_INSTALL AC_PROG_INSTALL
......
...@@ -65,8 +65,11 @@ libbsd_la_LIBADD = \ ...@@ -65,8 +65,11 @@ libbsd_la_LIBADD = \
$(ARC4RANDOM_ATFORK_LIBS) \ $(ARC4RANDOM_ATFORK_LIBS) \
$(nil) $(nil)
libbsd_la_LDFLAGS = \ libbsd_la_LDFLAGS = \
-Wl,--version-script=$(srcdir)/libbsd.map \
-version-number $(LIBBSD_ABI) -version-number $(LIBBSD_ABI)
if HAVE_LINKER_VERSION_SCRIPT
libbsd_la_LDFLAGS += \
-Wl,--version-script=$(srcdir)/libbsd.map
endif
libbsd_la_SOURCES = \ libbsd_la_SOURCES = \
arc4random.c \ arc4random.c \
arc4random.h \ arc4random.h \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment