mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-08 11:02:24 +01:00
build: Detect support for --version-script in ld
This commit is contained in:
parent
eb445425ff
commit
3d6b6ead64
19
configure.ac
19
configure.ac
@ -27,6 +27,25 @@ AC_SYS_LARGEFILE
|
||||
|
||||
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.
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
|
@ -65,8 +65,11 @@ libbsd_la_LIBADD = \
|
||||
$(ARC4RANDOM_ATFORK_LIBS) \
|
||||
$(nil)
|
||||
libbsd_la_LDFLAGS = \
|
||||
-Wl,--version-script=$(srcdir)/libbsd.map \
|
||||
-version-number $(LIBBSD_ABI)
|
||||
if HAVE_LINKER_VERSION_SCRIPT
|
||||
libbsd_la_LDFLAGS += \
|
||||
-Wl,--version-script=$(srcdir)/libbsd.map
|
||||
endif
|
||||
libbsd_la_SOURCES = \
|
||||
arc4random.c \
|
||||
arc4random.h \
|
||||
|
Loading…
Reference in New Issue
Block a user