From 470dd224e4b587137a482c6db3d765860bcba19c Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Tue, 3 Jun 2014 08:39:56 -0400 Subject: Add C backtrace API. Useful for at least debugging. Supported in Linux and OS X (possibly to some extent in *BSD). See perlhacktips for details. --- Configure | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'Configure') diff --git a/Configure b/Configure index f3f648b89c..f7056ef3b5 100755 --- a/Configure +++ b/Configure @@ -422,9 +422,11 @@ d_dbminitproto='' d_difftime='' d_dir_dd_fd='' d_dirfd='' +d_dladdr='' d_dlerror='' d_dlopen='' d_dlsymun='' +d_backtrace='' d_dosuid='' d_suidsafe='' d_drand48_r='' @@ -883,6 +885,7 @@ html3direxp='' installhtml3dir='' i_arpainet='' i_assert='' +i_bfd='' i_crypt='' db_hashtype='' db_prefixtype='' @@ -896,6 +899,7 @@ d_dirnamlen='' direntrytype='' i_dirent='' i_dlfcn='' +i_execinfo='' i_fcntl='' i_float='' i_fp='' @@ -1233,6 +1237,7 @@ uidtype='' archname64='' use64bitall='' use64bitint='' +usecbacktrace='' dtrace='' usedtrace='' usefaststdio='' @@ -5152,6 +5157,9 @@ esac case "$usesocks" in "$define") libswanted="$libswanted socks5 socks5_sh" ;; esac +case "$usecbacktrace" in +"$define") libswanted="$libswanted bfd" ;; +esac libsfound='' libsfiles='' libsdirs='' @@ -12209,6 +12217,10 @@ set d_dirfd eval $setvar $rm -f dirfd* +: see if dladdr exists +set dladdr d_dladdr +eval $inlibc + : see if dlerror exists xxx_runnm="$runnm" runnm=false @@ -12331,6 +12343,21 @@ $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.* set d_dlsymun eval $setvar +: see if backtrace exists +set backtrace d_backtrace +eval $inlibc + +: add flags if using c backtrace +case "$usecbacktrace" in +[yY]*|true|$define) + case " $ccflags " in + *" -DUSE_C_BACKTRACE "*) ;; # Already there. + *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" + ;; + esac + ;; +esac + : see if drand48_r exists set drand48_r d_drand48_r eval $inlibc @@ -12796,6 +12823,10 @@ case "$d_endservent_r" in ;; esac +: see if this is an execinfo.h system +set execinfo.h i_execinfo +eval $inhdr + : Locate the flags for 'open()' echo " " $cat >try.c <