mostang.com!davidm | 525afd5 | 2002-02-28 16:24:48 +0000 | [diff] [blame] | 1 | dnl Process this file with autoconf to produce a configure script. |
hp.com!davidm | 487beb8 | 2003-11-26 18:59:24 +0000 | [diff] [blame] | 2 | AC_INIT(libunwind, 0.95, libunwind@linux.hpl.hp.com) |
| 3 | AC_CONFIG_SRCDIR(src/backtrace.c) |
mostang.com!davidm | 525afd5 | 2002-02-28 16:24:48 +0000 | [diff] [blame] | 4 | AC_CONFIG_AUX_DIR(aux) |
| 5 | AC_CANONICAL_SYSTEM |
hp.com!davidm | 487beb8 | 2003-11-26 18:59:24 +0000 | [diff] [blame] | 6 | AM_INIT_AUTOMAKE |
mostang.com!davidm | 525afd5 | 2002-02-28 16:24:48 +0000 | [diff] [blame] | 7 | AM_MAINTAINER_MODE |
| 8 | AM_CONFIG_HEADER(include/config.h) |
| 9 | |
| 10 | dnl Checks for programs. |
| 11 | AC_PROG_CC |
mostang.com!davidm | 4f17bce | 2003-03-28 07:43:22 +0000 | [diff] [blame] | 12 | AC_PROG_CXX |
mostang.com!davidm | 525afd5 | 2002-02-28 16:24:48 +0000 | [diff] [blame] | 13 | AC_PROG_INSTALL |
| 14 | AC_PROG_MAKE_SET |
| 15 | AM_PROG_LIBTOOL |
hp.com!davidm | bbe86ee | 2003-02-14 03:09:27 +0000 | [diff] [blame] | 16 | AM_PROG_AS |
mostang.com!davidm | 525afd5 | 2002-02-28 16:24:48 +0000 | [diff] [blame] | 17 | |
| 18 | dnl Checks for libraries. |
mostang.com!davidm | ebfaebd | 2003-04-03 07:59:15 +0000 | [diff] [blame] | 19 | AC_CHECK_LIB(uca, __uc_get_grs) |
hp.com!davidm | 5e832c3 | 2003-11-24 21:37:22 +0000 | [diff] [blame] | 20 | CHECK_ATOMIC_OPS |
mostang.com!davidm | 525afd5 | 2002-02-28 16:24:48 +0000 | [diff] [blame] | 21 | |
| 22 | dnl Checks for header files. |
| 23 | AC_HEADER_STDC |
mostang.com!davidm | 6df7b10 | 2003-03-19 19:25:18 +0000 | [diff] [blame] | 24 | AC_CHECK_HEADERS(asm/ptrace_offsets.h endian.h execinfo.h ia64intrin.h \ |
hp.com!davidm | 197801e | 2003-09-25 05:29:14 +0000 | [diff] [blame] | 25 | sys/uc_access.h unistd.h signal.h) |
mostang.com!davidm | 525afd5 | 2002-02-28 16:24:48 +0000 | [diff] [blame] | 26 | |
| 27 | dnl Checks for typedefs, structures, and compiler characteristics. |
| 28 | AC_C_CONST |
| 29 | AC_C_INLINE |
mostang.com!davidm | 6df7b10 | 2003-03-19 19:25:18 +0000 | [diff] [blame] | 30 | AC_TYPE_SIGNAL |
mostang.com!davidm | 525afd5 | 2002-02-28 16:24:48 +0000 | [diff] [blame] | 31 | AC_TYPE_SIZE_T |
| 32 | |
hp.com!davidm | 197801e | 2003-09-25 05:29:14 +0000 | [diff] [blame] | 33 | CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE" |
| 34 | if test x$enable_debug = xyes; then |
| 35 | CPPFLAGS="${CPPFLAGS} -DDEBUG" |
| 36 | else |
| 37 | CPPFLAGS="${CPPFLAGS} -DNDEBUG" |
| 38 | fi |
| 39 | |
| 40 | AC_CHECK_TYPES([sighandler_t], [], [], |
| 41 | [$ac_includes_default |
| 42 | #if HAVE_SIGNAL_H |
| 43 | # include <signal.h> |
| 44 | #endif |
| 45 | ]) |
mostang.com!davidm | 6df7b10 | 2003-03-19 19:25:18 +0000 | [diff] [blame] | 46 | |
mostang.com!davidm | 525afd5 | 2002-02-28 16:24:48 +0000 | [diff] [blame] | 47 | dnl Checks for library functions. |
| 48 | AC_FUNC_MEMCMP |
| 49 | AC_TYPE_SIGNAL |
mostang.com!davidm | 6df7b10 | 2003-03-19 19:25:18 +0000 | [diff] [blame] | 50 | AC_CHECK_FUNCS(dl_iterate_phdr dlmodinfo getunwind ttrace) |
mostang.com!davidm | 525afd5 | 2002-02-28 16:24:48 +0000 | [diff] [blame] | 51 | |
mostang.com!davidm | 525afd5 | 2002-02-28 16:24:48 +0000 | [diff] [blame] | 52 | get_arch() { |
| 53 | case "$1" in |
| 54 | i?86) echo x86;; |
mostang.com!davidm | 9f3bcd7 | 2003-01-14 07:11:56 +0000 | [diff] [blame] | 55 | hppa*) echo hppa;; |
mostang.com!davidm | c9f6782 | 2002-12-19 07:16:50 +0000 | [diff] [blame] | 56 | *) echo $1;; |
mostang.com!davidm | 525afd5 | 2002-02-28 16:24:48 +0000 | [diff] [blame] | 57 | esac |
| 58 | } |
| 59 | |
| 60 | build_arch=`get_arch $build_cpu` |
| 61 | target_arch=`get_arch $target_cpu` |
| 62 | |
| 63 | AM_CONDITIONAL(REMOTE_ONLY, test x$target_arch != x$build_arch) |
mostang.com!davidm | b253a99 | 2003-01-16 03:10:11 +0000 | [diff] [blame] | 64 | AM_CONDITIONAL(ARCH_IA64, test x$target_arch = xia64) |
| 65 | AM_CONDITIONAL(ARCH_HPPA, test x$target_arch = xhppa) |
| 66 | AM_CONDITIONAL(ARCH_X86, test x$target_arch = xx86) |
mostang.com!davidm | 19a4e77 | 2003-02-08 10:10:59 +0000 | [diff] [blame] | 67 | AM_CONDITIONAL(OS_LINUX, expr x$target_os : xlinux >/dev/null) |
mostang.com!davidm | ebfaebd | 2003-04-03 07:59:15 +0000 | [diff] [blame] | 68 | AM_CONDITIONAL(OS_HPUX, expr x$target_os : xhpux >/dev/null) |
mostang.com!davidm | 525afd5 | 2002-02-28 16:24:48 +0000 | [diff] [blame] | 69 | |
| 70 | if test x$target_arch != x$build_arch; then |
| 71 | CPPFLAGS="${CPPFLAGS} -DUNW_REMOTE_ONLY" |
mostang.com!davidm | 525afd5 | 2002-02-28 16:24:48 +0000 | [diff] [blame] | 72 | fi |
mostang.com!davidm | 639ba64 | 2002-12-12 09:17:41 +0000 | [diff] [blame] | 73 | AC_CONFIG_LINKS(include/libunwind.h:include/libunwind-$target_arch.h |
| 74 | include/tdep.h:include/tdep-$target_arch.h) |
mostang.com!davidm | 525afd5 | 2002-02-28 16:24:48 +0000 | [diff] [blame] | 75 | |
| 76 | AC_ARG_ENABLE(debug, |
| 77 | [ --enable-debug turn on debug support (slows down execution)], |
| 78 | [enable_debug=yes], []) |
| 79 | |
mostang.com!davidm | 0a7fdb7 | 2002-11-09 07:59:02 +0000 | [diff] [blame] | 80 | LIBUNWIND___THREAD |
| 81 | |
mostang.com!davidm | 4e1f57e | 2002-07-18 03:58:34 +0000 | [diff] [blame] | 82 | if test x$GCC = xyes; then |
mostang.com!davidm | 19a4e77 | 2003-02-08 10:10:59 +0000 | [diff] [blame] | 83 | CFLAGS="${CFLAGS} -Wall -Wsign-compare" |
mostang.com!davidm | 4e1f57e | 2002-07-18 03:58:34 +0000 | [diff] [blame] | 84 | fi |
| 85 | |
hp.com!davidm | bbe86ee | 2003-02-14 03:09:27 +0000 | [diff] [blame] | 86 | CCASFLAGS="${CCASFLAGS} ${CPPFLAGS}" |
| 87 | |
hp.com!davidm | 41659aa | 2002-04-05 23:37:55 +0000 | [diff] [blame] | 88 | arch="$target_arch" |
mostang.com!davidm | 525afd5 | 2002-02-28 16:24:48 +0000 | [diff] [blame] | 89 | ARCH=`echo $target_arch | tr [a-z] [A-Z]` |
| 90 | |
hp.com!davidm | 41659aa | 2002-04-05 23:37:55 +0000 | [diff] [blame] | 91 | AC_SUBST(arch) |
mostang.com!davidm | 525afd5 | 2002-02-28 16:24:48 +0000 | [diff] [blame] | 92 | AC_SUBST(ARCH) |
mostang.com!davidm | bd94f81 | 2003-01-17 07:48:52 +0000 | [diff] [blame] | 93 | |
| 94 | AC_CONFIG_FILES(Makefile src/Makefile tests/Makefile |
| 95 | doc/Makefile doc/common.tex) |
| 96 | AC_OUTPUT |