@@ -2985,15 +2985,6 @@ AC_CHECK_HEADERS([ \
2985
2985
AC_HEADER_DIRENT
2986
2986
AC_HEADER_MAJOR
2987
2987
2988
- # for faulthandler
2989
- AC_CHECK_HEADERS ( [ execinfo.h link.h dlfcn.h] , [
2990
- AC_CHECK_FUNCS ( [ backtrace dladdr1] , [
2991
- # dladdr1 requires -ldl
2992
- ac_cv_require_ldl=yes
2993
- ] )
2994
- ] )
2995
- AS_VAR_IF ( [ ac_cv_require_ldl] , [ yes] , [ AS_VAR_APPEND ( [ LDFLAGS] , [ " -ldl"] ) ] )
2996
-
2997
2988
# bluetooth/bluetooth.h has been known to not compile with -std=c99.
2998
2989
# http://permalink.gmane.org/gmane.linux.bluez.kernel/22294
2999
2990
SAVE_CFLAGS=$CFLAGS
@@ -3715,6 +3706,22 @@ AC_CHECK_LIB([dl], [dlopen]) # Dynamic linking for SunOS/Solaris and SYSV
3715
3706
AC_CHECK_LIB ( [ dld] , [ shl_load] ) # Dynamic linking for HP-UX
3716
3707
3717
3708
3709
+ dnl for faulthandler
3710
+ AC_CHECK_HEADERS ( [ execinfo.h link.h dlfcn.h] , [
3711
+ AC_CHECK_FUNCS ( [ backtrace dladdr1] , [
3712
+ # dladdr1 requires -ldl
3713
+ ac_cv_require_ldl=yes
3714
+ ] )
3715
+ ] )
3716
+
3717
+ dnl only add -ldl to LDFLAGS if it isn't already part of LIBS (GH-133081)
3718
+ AS_VAR_IF ( [ ac_cv_require_ldl] , [ yes] , [
3719
+ AS_VAR_IF ( [ ac_cv_lib_dl_dlopen] , [ yes] , [ ] , [
3720
+ AS_VAR_APPEND ( [ LDFLAGS] , [ " -ldl"] )
3721
+ ] )
3722
+ ] )
3723
+
3724
+
3718
3725
dnl check for uuid dependencies
3719
3726
AH_TEMPLATE ( [ HAVE_UUID_H] , [ Define to 1 if you have the <uuid.h> header file.] )
3720
3727
AH_TEMPLATE ( [ HAVE_UUID_UUID_H] , [ Define to 1 if you have the <uuid/uuid.h> header file.] )
0 commit comments