Do not hard-code -ldl in fuzz/Makefile.am

* configure.ac: Search for dlopen and add library to $FUZZ_LIBS
* fuzz/Makefile.am: Link with $FUZZ_LIBS instead of -ldl

This fixes linking on BSD systems.

Reported-by: Nam Nguyen
This commit is contained in:
Tim Rühsen 2019-02-19 15:10:59 +01:00
parent c7f31d62b2
commit 1098de2b49
2 changed files with 10 additions and 1 deletions

View File

@ -103,6 +103,15 @@ AC_ARG_ENABLE([fuzzing],
#AC_SUBST([FUZZ_LIBS]) #AC_SUBST([FUZZ_LIBS])
AM_CONDITIONAL([FUZZING], [test "$enable_fuzzing" = "yes"]) AM_CONDITIONAL([FUZZING], [test "$enable_fuzzing" = "yes"])
dnl needed for some fuzzers
OLD_LIBS="$LIBS"
AC_SEARCH_LIBS([dlopen], [dl dld])
if [[ "${ac_cv_search_dlopen#-l}" != "${ac_cv_search_dlopen}" ]]; then
FUZZ_LIBS="${ac_cv_search_dlopen}"
AC_SUBST([FUZZ_LIBS])
fi
LIBS="$OLD_LIBS"
dnl Opie: Support for opie s/key FTP logins dnl Opie: Support for opie s/key FTP logins
AC_ARG_ENABLE([opie], AC_ARG_ENABLE([opie],
[AS_HELP_STRING([--disable-opie], [disable support for opie or s/key FTP login])], [AS_HELP_STRING([--disable-opie], [disable support for opie or s/key FTP login])],

View File

@ -6,7 +6,7 @@ LDADD = ../lib/libgnu.a \
$(LIBSOCKET) $(LIB_CLOCK_GETTIME) $(LIB_CRYPTO) $(LIB_GETLOGIN) $(LIB_NANOSLEEP) $(LIB_POLL) \ $(LIBSOCKET) $(LIB_CLOCK_GETTIME) $(LIB_CRYPTO) $(LIB_GETLOGIN) $(LIB_NANOSLEEP) $(LIB_POLL) \
$(LIB_POSIX_SPAWN) $(LIB_PTHREAD_SIGMASK) $(LIB_SELECT) $(LIBICONV) $(LIBINTL) \ $(LIB_POSIX_SPAWN) $(LIB_PTHREAD_SIGMASK) $(LIB_SELECT) $(LIBICONV) $(LIBINTL) \
$(LIBMULTITHREAD) $(LIBTHREAD) $(SERVENT_LIB) @INTL_MACOSX_LIBS@ \ $(LIBMULTITHREAD) $(LIBTHREAD) $(SERVENT_LIB) @INTL_MACOSX_LIBS@ \
-ldl $(FUZZ_LIBS)
WGET_TESTS = \ WGET_TESTS = \
wget_css_fuzzer$(EXEEXT) \ wget_css_fuzzer$(EXEEXT) \