summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-08-13 03:40:06 +0200
committerHaru <haru@dotalux.com>2015-08-13 04:15:58 +0200
commit1b4d33767fde9c55aa2e32f1a313688dc48a6ad4 (patch)
tree60d6a99177d72584e03c24f47af5f29a02fed623 /configure
parent08e100ec056ef7f8dabbbe33d3de14410c25f367 (diff)
downloadhercules-1b4d33767fde9c55aa2e32f1a313688dc48a6ad4.tar.gz
hercules-1b4d33767fde9c55aa2e32f1a313688dc48a6ad4.tar.bz2
hercules-1b4d33767fde9c55aa2e32f1a313688dc48a6ad4.tar.xz
hercules-1b4d33767fde9c55aa2e32f1a313688dc48a6ad4.zip
Added check for execinfo.h/backtrace() to the configure script
- This fixes compilation on systems such as FreeBSD, where -lexecinfo is necessary, or Cygwin, where execinfo.h is not available. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure74
1 files changed, 73 insertions, 1 deletions
diff --git a/configure b/configure
index b022ca2d5..2500494c9 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.in 3bd5d73.
+# From configure.in 08e100e.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69.
#
@@ -7988,6 +7988,78 @@ else
fi
+# execinfo (backtrace)
+for ac_header in execinfo.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "execinfo.h" "ac_cv_header_execinfo_h" "$ac_includes_default"
+if test "x$ac_cv_header_execinfo_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_EXECINFO_H 1
+_ACEOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing backtrace" >&5
+$as_echo_n "checking for library containing backtrace... " >&6; }
+if ${ac_cv_search_backtrace+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char backtrace ();
+int
+main ()
+{
+return backtrace ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' execinfo; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_backtrace=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_backtrace+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_backtrace+:} false; then :
+
+else
+ ac_cv_search_backtrace=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_backtrace" >&5
+$as_echo "$ac_cv_search_backtrace" >&6; }
+ac_res=$ac_cv_search_backtrace
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+ CFLAGS="$CFLAGS -DHAVE_EXECINFO"
+
+fi
+
+
+fi
+
+done
+
#
# MySQL library