blob: 00c8760d79b4800c4526d6cb9b986119f2e0ad98 [file] [log] [blame]
mostang.com!davidm525afd52002-02-28 16:24:48 +00001dnl Process this file with autoconf to produce a configure script.
hp.com!davidm487beb82003-11-26 18:59:24 +00002AC_INIT(libunwind, 0.95, libunwind@linux.hpl.hp.com)
3AC_CONFIG_SRCDIR(src/backtrace.c)
mostang.com!davidm525afd52002-02-28 16:24:48 +00004AC_CONFIG_AUX_DIR(aux)
5AC_CANONICAL_SYSTEM
hp.com!davidm487beb82003-11-26 18:59:24 +00006AM_INIT_AUTOMAKE
mostang.com!davidm525afd52002-02-28 16:24:48 +00007AM_MAINTAINER_MODE
8AM_CONFIG_HEADER(include/config.h)
9
10dnl Checks for programs.
11AC_PROG_CC
mostang.com!davidm4f17bce2003-03-28 07:43:22 +000012AC_PROG_CXX
mostang.com!davidm525afd52002-02-28 16:24:48 +000013AC_PROG_INSTALL
14AC_PROG_MAKE_SET
15AM_PROG_LIBTOOL
hp.com!davidmbbe86ee2003-02-14 03:09:27 +000016AM_PROG_AS
mostang.com!davidm525afd52002-02-28 16:24:48 +000017
18dnl Checks for libraries.
mostang.com!davidmebfaebd2003-04-03 07:59:15 +000019AC_CHECK_LIB(uca, __uc_get_grs)
hp.com!davidm5e832c32003-11-24 21:37:22 +000020CHECK_ATOMIC_OPS
mostang.com!davidm525afd52002-02-28 16:24:48 +000021
22dnl Checks for header files.
23AC_HEADER_STDC
mostang.com!davidm6df7b102003-03-19 19:25:18 +000024AC_CHECK_HEADERS(asm/ptrace_offsets.h endian.h execinfo.h ia64intrin.h \
hp.com!davidm197801e2003-09-25 05:29:14 +000025 sys/uc_access.h unistd.h signal.h)
mostang.com!davidm525afd52002-02-28 16:24:48 +000026
27dnl Checks for typedefs, structures, and compiler characteristics.
28AC_C_CONST
29AC_C_INLINE
mostang.com!davidm6df7b102003-03-19 19:25:18 +000030AC_TYPE_SIGNAL
mostang.com!davidm525afd52002-02-28 16:24:48 +000031AC_TYPE_SIZE_T
32
hp.com!davidm197801e2003-09-25 05:29:14 +000033CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"
34if test x$enable_debug = xyes; then
35 CPPFLAGS="${CPPFLAGS} -DDEBUG"
36else
37 CPPFLAGS="${CPPFLAGS} -DNDEBUG"
38fi
39
40AC_CHECK_TYPES([sighandler_t], [], [],
41[$ac_includes_default
42#if HAVE_SIGNAL_H
43# include <signal.h>
44#endif
45])
mostang.com!davidm6df7b102003-03-19 19:25:18 +000046
mostang.com!davidm525afd52002-02-28 16:24:48 +000047dnl Checks for library functions.
48AC_FUNC_MEMCMP
49AC_TYPE_SIGNAL
mostang.com!davidm6df7b102003-03-19 19:25:18 +000050AC_CHECK_FUNCS(dl_iterate_phdr dlmodinfo getunwind ttrace)
mostang.com!davidm525afd52002-02-28 16:24:48 +000051
mostang.com!davidm525afd52002-02-28 16:24:48 +000052get_arch() {
53 case "$1" in
54 i?86) echo x86;;
mostang.com!davidm9f3bcd72003-01-14 07:11:56 +000055 hppa*) echo hppa;;
mostang.com!davidmc9f67822002-12-19 07:16:50 +000056 *) echo $1;;
mostang.com!davidm525afd52002-02-28 16:24:48 +000057 esac
58}
59
60build_arch=`get_arch $build_cpu`
61target_arch=`get_arch $target_cpu`
62
63AM_CONDITIONAL(REMOTE_ONLY, test x$target_arch != x$build_arch)
mostang.com!davidmb253a992003-01-16 03:10:11 +000064AM_CONDITIONAL(ARCH_IA64, test x$target_arch = xia64)
65AM_CONDITIONAL(ARCH_HPPA, test x$target_arch = xhppa)
66AM_CONDITIONAL(ARCH_X86, test x$target_arch = xx86)
mostang.com!davidm19a4e772003-02-08 10:10:59 +000067AM_CONDITIONAL(OS_LINUX, expr x$target_os : xlinux >/dev/null)
mostang.com!davidmebfaebd2003-04-03 07:59:15 +000068AM_CONDITIONAL(OS_HPUX, expr x$target_os : xhpux >/dev/null)
mostang.com!davidm525afd52002-02-28 16:24:48 +000069
70if test x$target_arch != x$build_arch; then
71 CPPFLAGS="${CPPFLAGS} -DUNW_REMOTE_ONLY"
mostang.com!davidm525afd52002-02-28 16:24:48 +000072fi
mostang.com!davidm639ba642002-12-12 09:17:41 +000073AC_CONFIG_LINKS(include/libunwind.h:include/libunwind-$target_arch.h
74 include/tdep.h:include/tdep-$target_arch.h)
mostang.com!davidm525afd52002-02-28 16:24:48 +000075
76AC_ARG_ENABLE(debug,
77[ --enable-debug turn on debug support (slows down execution)],
78[enable_debug=yes], [])
79
mostang.com!davidm0a7fdb72002-11-09 07:59:02 +000080LIBUNWIND___THREAD
81
mostang.com!davidm4e1f57e2002-07-18 03:58:34 +000082if test x$GCC = xyes; then
mostang.com!davidm19a4e772003-02-08 10:10:59 +000083 CFLAGS="${CFLAGS} -Wall -Wsign-compare"
mostang.com!davidm4e1f57e2002-07-18 03:58:34 +000084fi
85
hp.com!davidmbbe86ee2003-02-14 03:09:27 +000086CCASFLAGS="${CCASFLAGS} ${CPPFLAGS}"
87
hp.com!davidm41659aa2002-04-05 23:37:55 +000088arch="$target_arch"
mostang.com!davidm525afd52002-02-28 16:24:48 +000089ARCH=`echo $target_arch | tr [a-z] [A-Z]`
90
hp.com!davidm41659aa2002-04-05 23:37:55 +000091AC_SUBST(arch)
mostang.com!davidm525afd52002-02-28 16:24:48 +000092AC_SUBST(ARCH)
mostang.com!davidmbd94f812003-01-17 07:48:52 +000093
94AC_CONFIG_FILES(Makefile src/Makefile tests/Makefile
95 doc/Makefile doc/common.tex)
96AC_OUTPUT