Commit 25922000 authored by vysheng's avatar vysheng

Add -lexecinfo if no bt found

parent 5cae1a7f
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
/* Define to 1 if you have the `edit' library (-ledit). */ /* Define to 1 if you have the `edit' library (-ledit). */
/* #undef HAVE_LIBEDIT */ /* #undef HAVE_LIBEDIT */
/* Define to 1 if you have the `execinfo' library (-lexecinfo). */
/* #undef HAVE_LIBEXECINFO */
/* Define to 1 if you have the `m' library (-lm). */ /* Define to 1 if you have the `m' library (-lm). */
#define HAVE_LIBM 1 #define HAVE_LIBM 1
......
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
/* Define to 1 if you have the `edit' library (-ledit). */ /* Define to 1 if you have the `edit' library (-ledit). */
#undef HAVE_LIBEDIT #undef HAVE_LIBEDIT
/* Define to 1 if you have the `execinfo' library (-lexecinfo). */
#undef HAVE_LIBEXECINFO
/* Define to 1 if you have the `m' library (-lm). */ /* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM #undef HAVE_LIBM
......
...@@ -1469,6 +1469,73 @@ fi ...@@ -1469,6 +1469,73 @@ fi
} # ac_fn_c_try_link } # ac_fn_c_try_link
# ac_fn_c_check_func LINENO FUNC VAR
# ----------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly
ac_fn_c_check_func ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
For example, HP-UX 11i <limits.h> declares gettimeofday. */
#define $2 innocuous_$2
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $2 (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
#undef $2
/* 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 $2 ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined __stub_$2 || defined __stub___$2
choke me
#endif
int
main ()
{
return $2 ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
eval "$3=yes"
else
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_func
# ac_fn_c_try_cpp LINENO # ac_fn_c_try_cpp LINENO
# ---------------------- # ----------------------
# Try to preprocess conftest.$ac_ext, and return whether this succeeded. # Try to preprocess conftest.$ac_ext, and return whether this succeeded.
...@@ -1719,73 +1786,6 @@ $as_echo "$ac_res" >&6; } ...@@ -1719,73 +1786,6 @@ $as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_type } # ac_fn_c_check_type
# ac_fn_c_check_func LINENO FUNC VAR
# ----------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly
ac_fn_c_check_func ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
For example, HP-UX 11i <limits.h> declares gettimeofday. */
#define $2 innocuous_$2
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $2 (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
#undef $2
/* 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 $2 ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined __stub_$2 || defined __stub___$2
choke me
#endif
int
main ()
{
return $2 ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
eval "$3=yes"
else
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_func
cat >config.log <<_ACEOF cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
...@@ -3028,6 +3028,66 @@ fi ...@@ -3028,6 +3028,66 @@ fi
EXTRA_LIBS="" EXTRA_LIBS=""
BT=
ac_fn_c_check_func "$LINENO" "backtrace" "ac_cv_func_backtrace"
if test "x$ac_cv_func_backtrace" = xyes; then :
BT=1
fi
if test "x$BT" = "x" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for backtrace in -lexecinfo" >&5
$as_echo_n "checking for backtrace in -lexecinfo... " >&6; }
if ${ac_cv_lib_execinfo_backtrace+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lexecinfo $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
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_execinfo_backtrace=yes
else
ac_cv_lib_execinfo_backtrace=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_execinfo_backtrace" >&5
$as_echo "$ac_cv_lib_execinfo_backtrace" >&6; }
if test "x$ac_cv_lib_execinfo_backtrace" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBEXECINFO 1
_ACEOF
LIBS="-lexecinfo $LIBS"
fi
EXTRA_LIBS+=" -lexecinfo" ;
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_save_prompt in -lreadline" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_save_prompt in -lreadline" >&5
$as_echo_n "checking for rl_save_prompt in -lreadline... " >&6; } $as_echo_n "checking for rl_save_prompt in -lreadline... " >&6; }
if ${ac_cv_lib_readline_rl_save_prompt+:} false; then : if ${ac_cv_lib_readline_rl_save_prompt+:} false; then :
......
...@@ -12,6 +12,21 @@ AC_CHECK_LIB([crypto], [AES_set_encrypt_key]) ...@@ -12,6 +12,21 @@ AC_CHECK_LIB([crypto], [AES_set_encrypt_key])
EXTRA_LIBS="" EXTRA_LIBS=""
BT=
AC_CHECK_FUNC([backtrace],
[
BT=1
],
[
]
)
if test "x$BT" = "x" ; then
AC_MSG_RESULT([no])
AC_CHECK_LIB([execinfo], [backtrace])
[ EXTRA_LIBS+=" -lexecinfo" ; ]
fi
AC_CHECK_LIB([readline], [rl_save_prompt], AC_CHECK_LIB([readline], [rl_save_prompt],
[ [
AC_DEFINE([READLINE_GNU], [1], [Use gnu libreadline]) AC_DEFINE([READLINE_GNU], [1], [Use gnu libreadline])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment