#ifdef HAVE_LINK_H
# include <link.h> // struct DL_info
#endif
-# if defined(__APPLE__) && defined(HAVE_BACKTRACE) && defined(HAVE_BACKTRACE_SYMBOLS) && defined(HAVE_DLADDR)
+# if defined(__APPLE__) && defined(HAVE_BACKTRACE) && defined(HAVE_DLADDR)
# define CAN_C_BACKTRACE
-# elif defined(HAVE_BACKTRACE) && defined(HAVE_BACKTRACE_SYMBOLS) && defined(HAVE_DLADDR1)
+# elif defined(HAVE_BACKTRACE) && defined(HAVE_DLADDR1)
# define CAN_C_BACKTRACE
# endif
#endif
_ACEOF
# dladdr1 requires -ldl
- as_fn_append LDFLAGS " -ldl"
+ ac_cv_require_ldl=yes
fi
fi
done
+if test "x$ac_cv_require_ldl" = xyes
+then :
+ as_fn_append LDFLAGS " -ldl"
+fi
# bluetooth/bluetooth.h has been known to not compile with -std=c99.
# http://permalink.gmane.org/gmane.linux.bluez.kernel/22294
AC_CHECK_HEADERS([execinfo.h link.h dlfcn.h], [
AC_CHECK_FUNCS([backtrace dladdr1], [
# dladdr1 requires -ldl
- AS_VAR_APPEND([LDFLAGS], [" -ldl"])
+ ac_cv_require_ldl=yes
])
])
+AS_VAR_IF([ac_cv_require_ldl], [yes], [AS_VAR_APPEND([LDFLAGS], [" -ldl"])])
# bluetooth/bluetooth.h has been known to not compile with -std=c99.
# http://permalink.gmane.org/gmane.linux.bluez.kernel/22294