diff options
-rwxr-xr-x | configure | 310 | ||||
-rw-r--r-- | configure.ac | 383 | ||||
-rw-r--r-- | src/char/Makefile.in | 18 | ||||
-rw-r--r-- | src/common/Makefile.in | 18 | ||||
-rw-r--r-- | src/login/Makefile.in | 18 | ||||
-rw-r--r-- | src/map/Makefile.in | 18 | ||||
-rw-r--r-- | src/test/Makefile.in | 18 |
7 files changed, 454 insertions, 329 deletions
@@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac 9bce92f63. +# From configure.ac aa7aba7b6. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # @@ -1366,7 +1366,8 @@ Optional Features: --enable-debug[=ARG] Compiles extra debug code. (yes by default) (available options: yes, no, gdb) --enable-libbacktrace[=ARG] - Compiles with libbacktrace. (yes by default) + Compiles with libbacktrace. (no by default - + experimental) --enable-buildbot[=ARG] (available options: yes, no) --enable-rdtsc Uses rdtsc as timing source (disabled by default) Enable it when you've timing issues. (For example: @@ -3810,7 +3811,7 @@ if test "${enable_libbacktrace+set}" = set; then : esac else - enable_libbacktrace="yes" + enable_libbacktrace="no" fi @@ -8596,15 +8597,13 @@ esac # # libbacktrace # -case $enable_libbacktrace in - "no") - # default value - USE_LIBBACKTRACE="no" - ;; - "yes") - CFLAGS="$CFLAGS " - CPPFLAGS="$CPPFLAGS -DHAVE_LIBBACKTRACE" - USE_LIBBACKTRACE="yes" +if test "$enable_libbacktrace" = "no" ; then + USE_LIBBACKTRACE="no" +else + CPPFLAGS="$CPPFLAGS -DHAVE_LIBBACKTRACE" + USE_LIBBACKTRACE="yes" + + # libbacktrace checks { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -funwind-tables" >&5 $as_echo_n "checking whether $CC supports -funwind-tables... " >&6; } @@ -8632,12 +8631,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ;; -esac -# libbacktrace checks - -for ac_prog in gawk mawk nawk awk + for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -8679,24 +8674,31 @@ fi test -n "$AWK" && break done -case "$AWK" in -"") as_fn_error $? "can't build without awk" "$LINENO" 5 ;; -esac + case "$AWK" in + "") + as_fn_error $? "Libbacktrace requires awk to build" "$LINENO" 5 + ;; + esac -backtrace_supported=yes -ac_fn_c_check_header_mongrel "$LINENO" "unwind.h" "ac_cv_header_unwind_h" "$ac_includes_default" + backtrace_supported=yes + ac_fn_c_check_header_mongrel "$LINENO" "unwind.h" "ac_cv_header_unwind_h" "$ac_includes_default" if test "x$ac_cv_header_unwind_h" = xyes; then : ac_fn_c_check_func "$LINENO" "_Unwind_Backtrace" "ac_cv_func__Unwind_Backtrace" if test "x$ac_cv_func__Unwind_Backtrace" = xyes; then : BACKTRACE_FILE="backtrace.lo simple.lo" else - BACKTRACE_FILE="nounwind.lo" - backtrace_supported=no + + BACKTRACE_FILE="nounwind.lo" + backtrace_supported=no + + fi else - BACKTRACE_FILE="nounwind.lo" - backtrace_supported=no + + BACKTRACE_FILE="nounwind.lo" + backtrace_supported=no + fi @@ -8707,98 +8709,121 @@ fi $as_echo "#define HAVE_GETIPINFO 1" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking __sync extensions" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking __sync extensions" >&5 $as_echo_n "checking __sync extensions... " >&6; } if ${libbacktrace_cv_sys_sync+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "${with_target_subdir}"; then - case "${host}" in - hppa*-*-hpux*) libbacktrace_cv_sys_sync=no ;; - *) libbacktrace_cv_sys_sync=yes ;; - esac - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + if test -n "${with_target_subdir}"; then + case "${host}" in + hppa*-*-hpux*) + libbacktrace_cv_sys_sync=no + ;; + *) + libbacktrace_cv_sys_sync=yes + ;; + esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int i; + + int i; int main () { -__sync_bool_compare_and_swap (&i, i, i); - __sync_lock_test_and_set (&i, 1); - __sync_lock_release (&i); + + __sync_bool_compare_and_swap(&i, i, i); + __sync_lock_test_and_set(&i, 1); + __sync_lock_release(&i); + + ; return 0; } + _ACEOF if ac_fn_c_try_link "$LINENO"; then : libbacktrace_cv_sys_sync=yes else libbacktrace_cv_sys_sync=no + fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - fi + fi + + fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libbacktrace_cv_sys_sync" >&5 $as_echo "$libbacktrace_cv_sys_sync" >&6; } -BACKTRACE_SUPPORTS_THREADS=0 -if test "$libbacktrace_cv_sys_sync" = "yes"; then - BACKTRACE_SUPPORTS_THREADS=1 + BACKTRACE_SUPPORTS_THREADS=0 + if test "$libbacktrace_cv_sys_sync" = "yes"; then + BACKTRACE_SUPPORTS_THREADS=1 $as_echo "#define HAVE_SYNC_FUNCTIONS 1" >>confdefs.h -fi + fi -# Test for __atomic support. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking __atomic extensions" >&5 + # Test for __atomic support. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking __atomic extensions" >&5 $as_echo_n "checking __atomic extensions... " >&6; } if ${libbacktrace_cv_sys_atomic+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "${with_target_subdir}"; then - libbacktrace_cv_sys_atomic=yes - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + if test -n "${with_target_subdir}"; then + libbacktrace_cv_sys_atomic=yes + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int i; + + int i; int main () { -__atomic_load_n (&i, __ATOMIC_ACQUIRE); - __atomic_store_n (&i, 1, __ATOMIC_RELEASE); + + __atomic_load_n(&i, __ATOMIC_ACQUIRE); + __atomic_store_n(&i, 1, __ATOMIC_RELEASE); + + ; return 0; } + _ACEOF if ac_fn_c_try_link "$LINENO"; then : libbacktrace_cv_sys_atomic=yes else libbacktrace_cv_sys_atomic=no + fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - fi + fi + + fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libbacktrace_cv_sys_atomic" >&5 $as_echo "$libbacktrace_cv_sys_atomic" >&6; } -if test "$libbacktrace_cv_sys_atomic" = "yes"; then + if test "$libbacktrace_cv_sys_atomic" = "yes"; then $as_echo "#define HAVE_ATOMIC_FUNCTIONS 1" >>confdefs.h -fi + fi -# The library needs to be able to read the executable itself. Compile -# a file to determine the executable format. The awk script -# filetype.awk prints out the file type. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking output filetype" >&5 + # The library needs to be able to read the executable itself. Compile + # a file to determine the executable format. The awk script + # filetype.awk prints out the file type. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking output filetype" >&5 $as_echo_n "checking output filetype... " >&6; } if ${libbacktrace_cv_sys_filetype+:} false; then : $as_echo_n "(cached) " >&6 else - filetype= -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + filetype= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int @@ -8816,74 +8841,93 @@ else $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "compiler failed See \`config.log' for more details" "$LINENO" 5; } + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -libbacktrace_cv_sys_filetype=$filetype + libbacktrace_cv_sys_filetype=$filetype + + fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libbacktrace_cv_sys_filetype" >&5 $as_echo "$libbacktrace_cv_sys_filetype" >&6; } -# Match the file type to decide what files to compile. -LIBBACKTRACE_FORMAT_FILE= -backtrace_supports_data=yes -case "$libbacktrace_cv_sys_filetype" in -elf*) LIBBACKTRACE_FORMAT_FILE="elf.o" ;; -pecoff) LIBBACKTRACE_FORMAT_FILE="pecoff.o" - backtrace_supports_data=no - ;; -xcoff*) LIBBACKTRACE_FORMAT_FILE="xcoff.o" - backtrace_supports_data=no - ;; -macho*) LIBBACKTRACE_FORMAT_FILE="macho.o" - backtrace_supports_data=no - ;; -*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not determine output file type" >&5 + # Match the file type to decide what files to compile. + LIBBACKTRACE_FORMAT_FILE= + backtrace_supports_data=yes + case "$libbacktrace_cv_sys_filetype" in + elf*) + LIBBACKTRACE_FORMAT_FILE="elf.o" + ;; + pecoff) + LIBBACKTRACE_FORMAT_FILE="pecoff.o" + backtrace_supports_data=no + ;; + xcoff*) + LIBBACKTRACE_FORMAT_FILE="xcoff.o" + backtrace_supports_data=no + ;; + macho*) + LIBBACKTRACE_FORMAT_FILE="macho.o" + backtrace_supports_data=no + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not determine output file type" >&5 $as_echo "$as_me: WARNING: could not determine output file type" >&2;} - LIBBACKTRACE_FORMAT_FILE="unknown.o" - backtrace_supported=no - ;; -esac + LIBBACKTRACE_FORMAT_FILE="unknown.o" + backtrace_supported=no + ;; + esac -# ELF defines. -elfsize= -case "$libbacktrace_cv_sys_filetype" in -elf32) elfsize=32 ;; -elf64) elfsize=64 ;; -*) elfsize=unused -esac + # ELF defines. + elfsize= + case "$libbacktrace_cv_sys_filetype" in + elf32) + elfsize=32 + ;; + elf64) + elfsize=64 + ;; + *) + elfsize=unused + esac cat >>confdefs.h <<_ACEOF #define BACKTRACE_ELF_SIZE $elfsize _ACEOF -# XCOFF defines. -xcoffsize= -case "$libbacktrace_cv_sys_filetype" in -xcoff32) xcoffsize=32 ;; -xcoff64) xcoffsize=64 ;; -*) xcoffsize=unused -esac + # XCOFF defines. + xcoffsize= + case "$libbacktrace_cv_sys_filetype" in + xcoff32) + xcoffsize=32 + ;; + xcoff64) + xcoffsize=64 + ;; + *) + xcoffsize=unused + esac cat >>confdefs.h <<_ACEOF #define BACKTRACE_XCOFF_SIZE $xcoffsize _ACEOF -BACKTRACE_SUPPORTED=0 -if test "$backtrace_supported" = "yes"; then - BACKTRACE_SUPPORTED=1 -fi + BACKTRACE_SUPPORTED=0 + if test "$backtrace_supported" = "yes"; then + BACKTRACE_SUPPORTED=1 + fi -BACKTRACE_SUPPORTS_DATA=0 -if test "$backtrace_supports_data" = "yes"; then - BACKTRACE_SUPPORTS_DATA=1 -fi + BACKTRACE_SUPPORTS_DATA=0 + if test "$backtrace_supports_data" = "yes"; then + BACKTRACE_SUPPORTS_DATA=1 + fi -ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" if test "x$ac_cv_func_mmap" = xyes; then : have_mmap=yes else @@ -8891,54 +8935,60 @@ else fi -VIEW_FILE=mmapio.lo -ALLOC_FILE=mmap.lo + VIEW_FILE=mmapio.lo + ALLOC_FILE=mmap.lo -BACKTRACE_USES_MALLOC=0 -if test "$ALLOC_FILE" = "alloc.lo"; then - BACKTRACE_USES_MALLOC=1 -fi + BACKTRACE_USES_MALLOC=0 + if test "$ALLOC_FILE" = "alloc.lo"; then + BACKTRACE_USES_MALLOC=1 + fi -ac_fn_c_check_func "$LINENO" "dl_iterate_phdr" "ac_cv_func_dl_iterate_phdr" + ac_fn_c_check_func "$LINENO" "dl_iterate_phdr" "ac_cv_func_dl_iterate_phdr" if test "x$ac_cv_func_dl_iterate_phdr" = xyes; then : have_dl_iterate_phdr=yes else have_dl_iterate_phdr=no fi -if test "$have_dl_iterate_phdr" = "yes"; then + if test "$have_dl_iterate_phdr" = "yes"; then $as_echo "#define HAVE_DL_ITERATE_PHDR 1" >>confdefs.h -fi + fi -# Check for the fcntl function. -if test -n "${with_target_subdir}"; then - case "${host}" in - *-*-mingw*) have_fcntl=no ;; - spu-*-*) have_fcntl=no ;; - *) have_fcntl=yes ;; - esac -else - ac_fn_c_check_func "$LINENO" "fcntl" "ac_cv_func_fcntl" + # Check for the fcntl function. + if test -n "${with_target_subdir}"; then + case "${host}" in + *-*-mingw*) + have_fcntl=no + ;; + spu-*-*) + have_fcntl=no + ;; + *) + have_fcntl=yes + ;; + esac + else + ac_fn_c_check_func "$LINENO" "fcntl" "ac_cv_func_fcntl" if test "x$ac_cv_func_fcntl" = xyes; then : have_fcntl=yes else have_fcntl=no fi -fi -if test "$have_fcntl" = "yes"; then + fi + if test "$have_fcntl" = "yes"; then $as_echo "#define HAVE_FCNTL 1" >>confdefs.h -fi + fi -ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default" + ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default" if test "x$ac_cv_have_decl_strnlen" = xyes; then : ac_have_decl=1 else @@ -8949,7 +8999,7 @@ cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRNLEN $ac_have_decl _ACEOF -for ac_func in lstat readlink + for ac_func in lstat readlink do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -8962,21 +9012,21 @@ fi done -ac_fn_c_check_func "$LINENO" "getexecname" "ac_cv_func_getexecname" + ac_fn_c_check_func "$LINENO" "getexecname" "ac_cv_func_getexecname" if test "x$ac_cv_func_getexecname" = xyes; then : have_getexecname=yes else have_getexecname=no fi -if test "$have_getexecname" = "yes"; then + if test "$have_getexecname" = "yes"; then $as_echo "#define HAVE_GETEXECNAME 1" >>confdefs.h + fi fi - # # Buildbot # diff --git a/configure.ac b/configure.ac index e85e4463a..e13fc4b6c 100644 --- a/configure.ac +++ b/configure.ac @@ -319,7 +319,7 @@ AC_ARG_ENABLE( AC_HELP_STRING( [--enable-libbacktrace@<:@=ARG@:>@], [ - Compiles with libbacktrace. (yes by default) + Compiles with libbacktrace. (no by default - experimental) ] ), [ @@ -330,7 +330,7 @@ AC_ARG_ENABLE( *) AC_MSG_ERROR([[invalid argument --enable-libbacktrace=$enableval... stopping]]);; esac ], - [enable_libbacktrace="yes"] + [enable_libbacktrace="no"] ) # @@ -1415,188 +1415,233 @@ esac # # libbacktrace # -case $enable_libbacktrace in - "no") - # default value - USE_LIBBACKTRACE="no" - ;; - "yes") - CFLAGS="$CFLAGS " - CPPFLAGS="$CPPFLAGS -DHAVE_LIBBACKTRACE" - USE_LIBBACKTRACE="yes" - AC_CHECK_FLAG(-funwind-tables) - ;; -esac +if test "$enable_libbacktrace" = "no" ; then + USE_LIBBACKTRACE="no" +else + CPPFLAGS="$CPPFLAGS -DHAVE_LIBBACKTRACE" + USE_LIBBACKTRACE="yes" + + # libbacktrace checks + AC_CHECK_FLAG(-funwind-tables) + + AC_PROG_AWK + case "$AWK" in + "") + AC_MSG_ERROR([Libbacktrace requires awk to build]) + ;; + esac + + backtrace_supported=yes + AC_CHECK_HEADER([unwind.h], + [AC_CHECK_FUNC([_Unwind_Backtrace], + [BACKTRACE_FILE="backtrace.lo simple.lo"], + [ + BACKTRACE_FILE="nounwind.lo" + backtrace_supported=no + ] + )], + [ + BACKTRACE_FILE="nounwind.lo" + backtrace_supported=no + ] + ) + AC_SUBST(BACKTRACE_FILE) -# libbacktrace checks + AC_DEFINE(HAVE_GETIPINFO, 1, [Define if _Unwind_GetIPInfo is available.]) -AC_PROG_AWK -case "$AWK" in -"") AC_MSG_ERROR([can't build without awk]) ;; -esac + AC_CACHE_CHECK([__sync extensions], + [libbacktrace_cv_sys_sync], + [ + if test -n "${with_target_subdir}"; then + case "${host}" in + hppa*-*-hpux*) + libbacktrace_cv_sys_sync=no + ;; + *) + libbacktrace_cv_sys_sync=yes + ;; + esac + else + AC_LINK_IFELSE( + [ + AC_LANG_PROGRAM([int i;], + [ + __sync_bool_compare_and_swap(&i, i, i); + __sync_lock_test_and_set(&i, 1); + __sync_lock_release(&i); + ] + ) + ], + [libbacktrace_cv_sys_sync=yes], + [libbacktrace_cv_sys_sync=no] + ) + fi + ] + ) + BACKTRACE_SUPPORTS_THREADS=0 + if test "$libbacktrace_cv_sys_sync" = "yes"; then + BACKTRACE_SUPPORTS_THREADS=1 + AC_DEFINE([HAVE_SYNC_FUNCTIONS], 1, [Define to 1 if you have the __sync functions]) + fi + AC_SUBST(BACKTRACE_SUPPORTS_THREADS) -backtrace_supported=yes -AC_CHECK_HEADER([unwind.h], - [AC_CHECK_FUNC([_Unwind_Backtrace], - [BACKTRACE_FILE="backtrace.lo simple.lo"], - [BACKTRACE_FILE="nounwind.lo" - backtrace_supported=no])], - [BACKTRACE_FILE="nounwind.lo" - backtrace_supported=no] -) -AC_SUBST(BACKTRACE_FILE) - -AC_DEFINE(HAVE_GETIPINFO, 1, [Define if _Unwind_GetIPInfo is available.]) - -AC_CACHE_CHECK([__sync extensions], -[libbacktrace_cv_sys_sync], -[if test -n "${with_target_subdir}"; then - case "${host}" in - hppa*-*-hpux*) libbacktrace_cv_sys_sync=no ;; - *) libbacktrace_cv_sys_sync=yes ;; - esac - else - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([int i;], - [__sync_bool_compare_and_swap (&i, i, i); - __sync_lock_test_and_set (&i, 1); - __sync_lock_release (&i);])], - [libbacktrace_cv_sys_sync=yes], - [libbacktrace_cv_sys_sync=no]) - fi]) -BACKTRACE_SUPPORTS_THREADS=0 -if test "$libbacktrace_cv_sys_sync" = "yes"; then - BACKTRACE_SUPPORTS_THREADS=1 - AC_DEFINE([HAVE_SYNC_FUNCTIONS], 1, - [Define to 1 if you have the __sync functions]) -fi -AC_SUBST(BACKTRACE_SUPPORTS_THREADS) - -# Test for __atomic support. -AC_CACHE_CHECK([__atomic extensions], -[libbacktrace_cv_sys_atomic], -[if test -n "${with_target_subdir}"; then - libbacktrace_cv_sys_atomic=yes - else - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([int i;], - [__atomic_load_n (&i, __ATOMIC_ACQUIRE); - __atomic_store_n (&i, 1, __ATOMIC_RELEASE);])], - [libbacktrace_cv_sys_atomic=yes], - [libbacktrace_cv_sys_atomic=no]) - fi]) -if test "$libbacktrace_cv_sys_atomic" = "yes"; then - AC_DEFINE([HAVE_ATOMIC_FUNCTIONS], 1, - [Define to 1 if you have the __atomic functions]) -fi + # Test for __atomic support. + AC_CACHE_CHECK([__atomic extensions], + [libbacktrace_cv_sys_atomic], + [ + if test -n "${with_target_subdir}"; then + libbacktrace_cv_sys_atomic=yes + else + AC_LINK_IFELSE( + [ + AC_LANG_PROGRAM([int i;], + [ + __atomic_load_n(&i, __ATOMIC_ACQUIRE); + __atomic_store_n(&i, 1, __ATOMIC_RELEASE); + ] + ) + ], + [libbacktrace_cv_sys_atomic=yes], + [libbacktrace_cv_sys_atomic=no] + ) + fi + ] + ) + if test "$libbacktrace_cv_sys_atomic" = "yes"; then + AC_DEFINE([HAVE_ATOMIC_FUNCTIONS], 1, [Define to 1 if you have the __atomic functions]) + fi -# The library needs to be able to read the executable itself. Compile -# a file to determine the executable format. The awk script -# filetype.awk prints out the file type. -AC_CACHE_CHECK([output filetype], -[libbacktrace_cv_sys_filetype], -[filetype= -AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([int i;], [int j;])], - [filetype=`${AWK} -f $srcdir/3rdparty/libbacktrace/filetype.awk conftest.$ac_objext`], - [AC_MSG_FAILURE([compiler failed])]) -libbacktrace_cv_sys_filetype=$filetype]) - -# Match the file type to decide what files to compile. -LIBBACKTRACE_FORMAT_FILE= -backtrace_supports_data=yes -case "$libbacktrace_cv_sys_filetype" in -elf*) LIBBACKTRACE_FORMAT_FILE="elf.o" ;; -pecoff) LIBBACKTRACE_FORMAT_FILE="pecoff.o" - backtrace_supports_data=no - ;; -xcoff*) LIBBACKTRACE_FORMAT_FILE="xcoff.o" - backtrace_supports_data=no - ;; -macho*) LIBBACKTRACE_FORMAT_FILE="macho.o" - backtrace_supports_data=no - ;; -*) AC_MSG_WARN([could not determine output file type]) - LIBBACKTRACE_FORMAT_FILE="unknown.o" - backtrace_supported=no - ;; -esac -AC_SUBST(LIBBACKTRACE_FORMAT_FILE) - -# ELF defines. -elfsize= -case "$libbacktrace_cv_sys_filetype" in -elf32) elfsize=32 ;; -elf64) elfsize=64 ;; -*) elfsize=unused -esac -AC_DEFINE_UNQUOTED([BACKTRACE_ELF_SIZE], [$elfsize], [ELF size: 32 or 64]) - -# XCOFF defines. -xcoffsize= -case "$libbacktrace_cv_sys_filetype" in -xcoff32) xcoffsize=32 ;; -xcoff64) xcoffsize=64 ;; -*) xcoffsize=unused -esac -AC_DEFINE_UNQUOTED([BACKTRACE_XCOFF_SIZE], [$xcoffsize], [XCOFF size: 32 or 64]) + # The library needs to be able to read the executable itself. Compile + # a file to determine the executable format. The awk script + # filetype.awk prints out the file type. + AC_CACHE_CHECK([output filetype], + [libbacktrace_cv_sys_filetype], + [ + filetype= + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([int i;], [int j;])], + [filetype=`${AWK} -f $srcdir/3rdparty/libbacktrace/filetype.awk conftest.$ac_objext`], + [AC_MSG_FAILURE([compiler failed])] + ) + libbacktrace_cv_sys_filetype=$filetype + ] + ) -BACKTRACE_SUPPORTED=0 -if test "$backtrace_supported" = "yes"; then - BACKTRACE_SUPPORTED=1 -fi -AC_SUBST(BACKTRACE_SUPPORTED) + # Match the file type to decide what files to compile. + LIBBACKTRACE_FORMAT_FILE= + backtrace_supports_data=yes + case "$libbacktrace_cv_sys_filetype" in + elf*) + LIBBACKTRACE_FORMAT_FILE="elf.o" + ;; + pecoff) + LIBBACKTRACE_FORMAT_FILE="pecoff.o" + backtrace_supports_data=no + ;; + xcoff*) + LIBBACKTRACE_FORMAT_FILE="xcoff.o" + backtrace_supports_data=no + ;; + macho*) + LIBBACKTRACE_FORMAT_FILE="macho.o" + backtrace_supports_data=no + ;; + *) + AC_MSG_WARN([could not determine output file type]) + LIBBACKTRACE_FORMAT_FILE="unknown.o" + backtrace_supported=no + ;; + esac + AC_SUBST(LIBBACKTRACE_FORMAT_FILE) + + # ELF defines. + elfsize= + case "$libbacktrace_cv_sys_filetype" in + elf32) + elfsize=32 + ;; + elf64) + elfsize=64 + ;; + *) + elfsize=unused + esac + AC_DEFINE_UNQUOTED([BACKTRACE_ELF_SIZE], [$elfsize], [ELF size: 32 or 64]) + + # XCOFF defines. + xcoffsize= + case "$libbacktrace_cv_sys_filetype" in + xcoff32) + xcoffsize=32 + ;; + xcoff64) + xcoffsize=64 + ;; + *) + xcoffsize=unused + esac + AC_DEFINE_UNQUOTED([BACKTRACE_XCOFF_SIZE], [$xcoffsize], [XCOFF size: 32 or 64]) + + BACKTRACE_SUPPORTED=0 + if test "$backtrace_supported" = "yes"; then + BACKTRACE_SUPPORTED=1 + fi + AC_SUBST(BACKTRACE_SUPPORTED) -BACKTRACE_SUPPORTS_DATA=0 -if test "$backtrace_supports_data" = "yes"; then - BACKTRACE_SUPPORTS_DATA=1 -fi -AC_SUBST(BACKTRACE_SUPPORTS_DATA) + BACKTRACE_SUPPORTS_DATA=0 + if test "$backtrace_supports_data" = "yes"; then + BACKTRACE_SUPPORTS_DATA=1 + fi + AC_SUBST(BACKTRACE_SUPPORTS_DATA) -AC_CHECK_FUNC(mmap, [have_mmap=yes], [have_mmap=no]) + AC_CHECK_FUNC(mmap, [have_mmap=yes], [have_mmap=no]) -VIEW_FILE=mmapio.lo -ALLOC_FILE=mmap.lo + VIEW_FILE=mmapio.lo + ALLOC_FILE=mmap.lo -AC_SUBST(VIEW_FILE) -AC_SUBST(ALLOC_FILE) + AC_SUBST(VIEW_FILE) + AC_SUBST(ALLOC_FILE) -BACKTRACE_USES_MALLOC=0 -if test "$ALLOC_FILE" = "alloc.lo"; then - BACKTRACE_USES_MALLOC=1 -fi -AC_SUBST(BACKTRACE_USES_MALLOC) + BACKTRACE_USES_MALLOC=0 + if test "$ALLOC_FILE" = "alloc.lo"; then + BACKTRACE_USES_MALLOC=1 + fi + AC_SUBST(BACKTRACE_USES_MALLOC) -AC_CHECK_FUNC([dl_iterate_phdr], [have_dl_iterate_phdr=yes], - [have_dl_iterate_phdr=no]) -if test "$have_dl_iterate_phdr" = "yes"; then - AC_DEFINE(HAVE_DL_ITERATE_PHDR, 1, [Define if dl_iterate_phdr is available.]) -fi + AC_CHECK_FUNC([dl_iterate_phdr], [have_dl_iterate_phdr=yes], [have_dl_iterate_phdr=no]) + if test "$have_dl_iterate_phdr" = "yes"; then + AC_DEFINE(HAVE_DL_ITERATE_PHDR, 1, [Define if dl_iterate_phdr is available.]) + fi -# Check for the fcntl function. -if test -n "${with_target_subdir}"; then - case "${host}" in - *-*-mingw*) have_fcntl=no ;; - spu-*-*) have_fcntl=no ;; - *) have_fcntl=yes ;; - esac -else - AC_CHECK_FUNC(fcntl, [have_fcntl=yes], [have_fcntl=no]) -fi -if test "$have_fcntl" = "yes"; then - AC_DEFINE([HAVE_FCNTL], 1, - [Define to 1 if you have the fcntl function]) -fi + # Check for the fcntl function. + if test -n "${with_target_subdir}"; then + case "${host}" in + *-*-mingw*) + have_fcntl=no + ;; + spu-*-*) + have_fcntl=no + ;; + *) + have_fcntl=yes + ;; + esac + else + AC_CHECK_FUNC(fcntl, [have_fcntl=yes], [have_fcntl=no]) + fi + if test "$have_fcntl" = "yes"; then + AC_DEFINE([HAVE_FCNTL], 1, [Define to 1 if you have the fcntl function]) + fi -AC_CHECK_DECLS(strnlen) -AC_CHECK_FUNCS(lstat readlink) + AC_CHECK_DECLS(strnlen) + AC_CHECK_FUNCS(lstat readlink) -AC_CHECK_FUNC(getexecname, [have_getexecname=yes], [have_getexecname=no]) -if test "$have_getexecname" = "yes"; then - AC_DEFINE(HAVE_GETEXECNAME, 1, [Define if getexecname is available.]) + AC_CHECK_FUNC(getexecname, [have_getexecname=yes], [have_getexecname=no]) + if test "$have_getexecname" = "yes"; then + AC_DEFINE(HAVE_GETEXECNAME, 1, [Define if getexecname is available.]) + fi fi - - +AC_SUBST(USE_LIBBACKTRACE) # # Buildbot diff --git a/src/char/Makefile.in b/src/char/Makefile.in index dc687d589..88a99c96c 100644 --- a/src/char/Makefile.in +++ b/src/char/Makefile.in @@ -36,12 +36,18 @@ LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \ LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \ scanctx.h scanner.h strbuf.h wincompat.h) -LIBBACKTRACE_D = $(THIRDPARTY_D)/libbacktrace -LIBBACKTRACE_OBJ = $(addprefix $(LIBBACKTRACE_D)/, atomic.o backtrace.o \ - dwarf.o @LIBBACKTRACE_FORMAT_FILE@ fileline.o mmapio.o mmap.o posix.o print.o \ - simple.o sort.o state.o) -LIBBACKTRACE_H = $(addprefix $(LIBBACKTRACE_D)/, backtrace.h \ - backtrace-supported.h config.h filenames.h internal.h) +ifeq (@USE_LIBBACKTRACE@,yes) + LIBBACKTRACE_D = $(THIRDPARTY_D)/libbacktrace + LIBBACKTRACE_OBJ = $(addprefix $(LIBBACKTRACE_D)/, atomic.o backtrace.o \ + dwarf.o @LIBBACKTRACE_FORMAT_FILE@ fileline.o mmapio.o mmap.o posix.o print.o \ + simple.o sort.o state.o) + LIBBACKTRACE_H = $(addprefix $(LIBBACKTRACE_D)/, backtrace.h \ + backtrace-supported.h config.h filenames.h internal.h) +else + LIBBACKTRACE_D = + LIBBACKTRACE_OBJ = + LIBBACKTRACE_H = +endif MT19937AR_D = $(THIRDPARTY_D)/mt19937ar MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o diff --git a/src/common/Makefile.in b/src/common/Makefile.in index 97ba34775..22b974cfd 100644 --- a/src/common/Makefile.in +++ b/src/common/Makefile.in @@ -33,12 +33,18 @@ LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \ LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \ scanctx.h scanner.h strbuf.h wincompat.h) -LIBBACKTRACE_D = $(THIRDPARTY_D)/libbacktrace -LIBBACKTRACE_OBJ = $(addprefix $(LIBBACKTRACE_D)/, atomic.o backtrace.o \ - dwarf.o @LIBBACKTRACE_FORMAT_FILE@ fileline.o mmapio.o mmap.o posix.o print.o \ - simple.o sort.o state.o) -LIBBACKTRACE_H = $(addprefix $(LIBBACKTRACE_D)/, backtrace.h \ - backtrace-supported.h config.h filenames.h internal.h) +ifeq (@USE_LIBBACKTRACE@,yes) + LIBBACKTRACE_D = $(THIRDPARTY_D)/libbacktrace + LIBBACKTRACE_OBJ = $(addprefix $(LIBBACKTRACE_D)/, atomic.o backtrace.o \ + dwarf.o @LIBBACKTRACE_FORMAT_FILE@ fileline.o mmapio.o mmap.o posix.o print.o \ + simple.o sort.o state.o) + LIBBACKTRACE_H = $(addprefix $(LIBBACKTRACE_D)/, backtrace.h \ + backtrace-supported.h config.h filenames.h internal.h) +else + LIBBACKTRACE_D = + LIBBACKTRACE_OBJ = + LIBBACKTRACE_H = +endif MT19937AR_D = $(THIRDPARTY_D)/mt19937ar MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o diff --git a/src/login/Makefile.in b/src/login/Makefile.in index 4f180070c..7252eea04 100644 --- a/src/login/Makefile.in +++ b/src/login/Makefile.in @@ -36,12 +36,18 @@ LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \ LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \ scanctx.h scanner.h strbuf.h wincompat.h) -LIBBACKTRACE_D = $(THIRDPARTY_D)/libbacktrace -LIBBACKTRACE_OBJ = $(addprefix $(LIBBACKTRACE_D)/, atomic.o backtrace.o \ - dwarf.o @LIBBACKTRACE_FORMAT_FILE@ fileline.o mmapio.o mmap.o posix.o print.o \ - simple.o sort.o state.o) -LIBBACKTRACE_H = $(addprefix $(LIBBACKTRACE_D)/, backtrace.h \ - backtrace-supported.h config.h filenames.h internal.h) +ifeq (@USE_LIBBACKTRACE@,yes) + LIBBACKTRACE_D = $(THIRDPARTY_D)/libbacktrace + LIBBACKTRACE_OBJ = $(addprefix $(LIBBACKTRACE_D)/, atomic.o backtrace.o \ + dwarf.o @LIBBACKTRACE_FORMAT_FILE@ fileline.o mmapio.o mmap.o posix.o print.o \ + simple.o sort.o state.o) + LIBBACKTRACE_H = $(addprefix $(LIBBACKTRACE_D)/, backtrace.h \ + backtrace-supported.h config.h filenames.h internal.h) +else + LIBBACKTRACE_D = + LIBBACKTRACE_OBJ = + LIBBACKTRACE_H = +endif MT19937AR_D = $(THIRDPARTY_D)/mt19937ar MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o diff --git a/src/map/Makefile.in b/src/map/Makefile.in index 2b050e99c..75093662f 100644 --- a/src/map/Makefile.in +++ b/src/map/Makefile.in @@ -36,12 +36,18 @@ LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \ LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \ scanctx.h scanner.h strbuf.h wincompat.h) -LIBBACKTRACE_D = $(THIRDPARTY_D)/libbacktrace -LIBBACKTRACE_OBJ = $(addprefix $(LIBBACKTRACE_D)/, atomic.o backtrace.o \ - dwarf.o @LIBBACKTRACE_FORMAT_FILE@ fileline.o mmapio.o mmap.o posix.o print.o \ - simple.o sort.o state.o) -LIBBACKTRACE_H = $(addprefix $(LIBBACKTRACE_D)/, backtrace.h \ - backtrace-supported.h config.h filenames.h internal.h) +ifeq (@USE_LIBBACKTRACE@,yes) + LIBBACKTRACE_D = $(THIRDPARTY_D)/libbacktrace + LIBBACKTRACE_OBJ = $(addprefix $(LIBBACKTRACE_D)/, atomic.o backtrace.o \ + dwarf.o @LIBBACKTRACE_FORMAT_FILE@ fileline.o mmapio.o mmap.o posix.o print.o \ + simple.o sort.o state.o) + LIBBACKTRACE_H = $(addprefix $(LIBBACKTRACE_D)/, backtrace.h \ + backtrace-supported.h config.h filenames.h internal.h) +else + LIBBACKTRACE_D = + LIBBACKTRACE_OBJ = + LIBBACKTRACE_H = +endif MT19937AR_D = $(THIRDPARTY_D)/mt19937ar MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o diff --git a/src/test/Makefile.in b/src/test/Makefile.in index 967d7dcfc..91263c939 100644 --- a/src/test/Makefile.in +++ b/src/test/Makefile.in @@ -36,12 +36,18 @@ LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \ LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \ scanctx.h scanner.h strbuf.h wincompat.h) -LIBBACKTRACE_D = $(THIRDPARTY_D)/libbacktrace -LIBBACKTRACE_OBJ = $(addprefix $(LIBBACKTRACE_D)/, atomic.o backtrace.o \ - dwarf.o @LIBBACKTRACE_FORMAT_FILE@ fileline.o mmapio.o mmap.o posix.o print.o \ - simple.o sort.o state.o) -LIBBACKTRACE_H = $(addprefix $(LIBBACKTRACE_D)/, backtrace.h \ - backtrace-supported.h config.h filenames.h internal.h) +ifeq (@USE_LIBBACKTRACE@,yes) + LIBBACKTRACE_D = $(THIRDPARTY_D)/libbacktrace + LIBBACKTRACE_OBJ = $(addprefix $(LIBBACKTRACE_D)/, atomic.o backtrace.o \ + dwarf.o @LIBBACKTRACE_FORMAT_FILE@ fileline.o mmapio.o mmap.o posix.o print.o \ + simple.o sort.o state.o) + LIBBACKTRACE_H = $(addprefix $(LIBBACKTRACE_D)/, backtrace.h \ + backtrace-supported.h config.h filenames.h internal.h) +else + LIBBACKTRACE_D = + LIBBACKTRACE_OBJ = + LIBBACKTRACE_H = +endif MT19937AR_D = $(THIRDPARTY_D)/mt19937ar MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o |