2002-02-28 17:24:48 +01:00
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
2004-04-28 06:43:25 +02:00
|
|
|
AC_INIT(libunwind, 0.97, libunwind@linux.hpl.hp.com)
|
2004-03-30 03:56:19 +02:00
|
|
|
AC_CONFIG_SRCDIR(src/mi/backtrace.c)
|
2004-07-15 19:39:59 +02:00
|
|
|
AC_CONFIG_AUX_DIR(config)
|
2002-02-28 17:24:48 +01:00
|
|
|
AC_CANONICAL_SYSTEM
|
2003-11-26 19:59:24 +01:00
|
|
|
AM_INIT_AUTOMAKE
|
2002-02-28 17:24:48 +01:00
|
|
|
AM_MAINTAINER_MODE
|
|
|
|
AM_CONFIG_HEADER(include/config.h)
|
|
|
|
|
|
|
|
dnl Checks for programs.
|
|
|
|
AC_PROG_CC
|
2003-03-28 08:43:22 +01:00
|
|
|
AC_PROG_CXX
|
2002-02-28 17:24:48 +01:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
AM_PROG_LIBTOOL
|
2003-02-14 04:09:27 +01:00
|
|
|
AM_PROG_AS
|
2002-02-28 17:24:48 +01:00
|
|
|
|
|
|
|
dnl Checks for libraries.
|
2003-04-03 09:59:15 +02:00
|
|
|
AC_CHECK_LIB(uca, __uc_get_grs)
|
2003-11-24 22:37:22 +01:00
|
|
|
CHECK_ATOMIC_OPS
|
2002-02-28 17:24:48 +01:00
|
|
|
|
|
|
|
dnl Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
2003-03-19 20:25:18 +01:00
|
|
|
AC_CHECK_HEADERS(asm/ptrace_offsets.h endian.h execinfo.h ia64intrin.h \
|
2003-09-25 07:29:14 +02:00
|
|
|
sys/uc_access.h unistd.h signal.h)
|
2002-02-28 17:24:48 +01:00
|
|
|
|
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_CONST
|
|
|
|
AC_C_INLINE
|
2003-03-19 20:25:18 +01:00
|
|
|
AC_TYPE_SIGNAL
|
2002-02-28 17:24:48 +01:00
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
|
2003-09-25 07:29:14 +02:00
|
|
|
CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"
|
|
|
|
if test x$enable_debug = xyes; then
|
|
|
|
CPPFLAGS="${CPPFLAGS} -DDEBUG"
|
|
|
|
else
|
|
|
|
CPPFLAGS="${CPPFLAGS} -DNDEBUG"
|
|
|
|
fi
|
|
|
|
|
2004-01-24 07:45:18 +01:00
|
|
|
AC_CHECK_MEMBERS([struct dl_phdr_info.dlpi_subs],,,[#include <link.h>])
|
2003-09-25 07:29:14 +02:00
|
|
|
AC_CHECK_TYPES([sighandler_t], [], [],
|
|
|
|
[$ac_includes_default
|
|
|
|
#if HAVE_SIGNAL_H
|
|
|
|
# include <signal.h>
|
|
|
|
#endif
|
|
|
|
])
|
2003-03-19 20:25:18 +01:00
|
|
|
|
2002-02-28 17:24:48 +01:00
|
|
|
dnl Checks for library functions.
|
|
|
|
AC_FUNC_MEMCMP
|
|
|
|
AC_TYPE_SIGNAL
|
2004-04-20 18:53:44 +02:00
|
|
|
AC_CHECK_FUNCS(dl_iterate_phdr dl_phdr_removals_counter dlmodinfo getunwind \
|
|
|
|
ttrace)
|
2002-02-28 17:24:48 +01:00
|
|
|
|
|
|
|
get_arch() {
|
|
|
|
case "$1" in
|
|
|
|
i?86) echo x86;;
|
2003-01-14 08:11:56 +01:00
|
|
|
hppa*) echo hppa;;
|
2002-12-19 08:16:50 +01:00
|
|
|
*) echo $1;;
|
2002-02-28 17:24:48 +01:00
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
build_arch=`get_arch $build_cpu`
|
|
|
|
target_arch=`get_arch $target_cpu`
|
|
|
|
|
|
|
|
AM_CONDITIONAL(REMOTE_ONLY, test x$target_arch != x$build_arch)
|
2003-01-16 04:10:11 +01:00
|
|
|
AM_CONDITIONAL(ARCH_IA64, test x$target_arch = xia64)
|
|
|
|
AM_CONDITIONAL(ARCH_HPPA, test x$target_arch = xhppa)
|
|
|
|
AM_CONDITIONAL(ARCH_X86, test x$target_arch = xx86)
|
2003-02-08 11:10:59 +01:00
|
|
|
AM_CONDITIONAL(OS_LINUX, expr x$target_os : xlinux >/dev/null)
|
2003-04-03 09:59:15 +02:00
|
|
|
AM_CONDITIONAL(OS_HPUX, expr x$target_os : xhpux >/dev/null)
|
2002-02-28 17:24:48 +01:00
|
|
|
|
|
|
|
if test x$target_arch != x$build_arch; then
|
|
|
|
CPPFLAGS="${CPPFLAGS} -DUNW_REMOTE_ONLY"
|
|
|
|
fi
|
2002-12-12 10:17:41 +01:00
|
|
|
AC_CONFIG_LINKS(include/libunwind.h:include/libunwind-$target_arch.h
|
|
|
|
include/tdep.h:include/tdep-$target_arch.h)
|
2002-02-28 17:24:48 +01:00
|
|
|
|
|
|
|
AC_ARG_ENABLE(debug,
|
|
|
|
[ --enable-debug turn on debug support (slows down execution)],
|
|
|
|
[enable_debug=yes], [])
|
|
|
|
|
2002-11-09 08:59:02 +01:00
|
|
|
LIBUNWIND___THREAD
|
|
|
|
|
2004-04-20 18:53:44 +02:00
|
|
|
save_LDFLAGS="$LDFLAGS"
|
|
|
|
LDFLAGS="$LDFLAGS -static-libcxa"
|
|
|
|
AC_TRY_LINK([], [], [have_static_libcxa=yes])
|
|
|
|
LDFLAGS="$save_LDFLAGS"
|
|
|
|
if test "x$have_static_libcxa" = xyes; then
|
|
|
|
LDFLAGS_STATIC_LIBCXA="-XCClinker -static-libcxa"
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_TRY_COMPILE([], [#ifndef __INTEL_COMPILER
|
|
|
|
#error choke me
|
|
|
|
#endif], [intel_compiler=yes])
|
|
|
|
|
|
|
|
if test x$GCC = xyes -a x$intel_compiler != xyes; then
|
2003-02-08 11:10:59 +01:00
|
|
|
CFLAGS="${CFLAGS} -Wall -Wsign-compare"
|
2002-07-18 05:58:34 +02:00
|
|
|
fi
|
|
|
|
|
2003-02-14 04:09:27 +01:00
|
|
|
CCASFLAGS="${CCASFLAGS} ${CPPFLAGS}"
|
|
|
|
|
2002-04-06 01:37:55 +02:00
|
|
|
arch="$target_arch"
|
2002-02-28 17:24:48 +01:00
|
|
|
ARCH=`echo $target_arch | tr [a-z] [A-Z]`
|
|
|
|
|
2004-05-05 03:58:44 +02:00
|
|
|
AC_SUBST(build_arch)
|
|
|
|
AC_SUBST(target_os)
|
2002-04-06 01:37:55 +02:00
|
|
|
AC_SUBST(arch)
|
2002-02-28 17:24:48 +01:00
|
|
|
AC_SUBST(ARCH)
|
2004-04-20 18:53:44 +02:00
|
|
|
AC_SUBST(LDFLAGS_STATIC_LIBCXA)
|
2003-01-17 08:48:52 +01:00
|
|
|
|
2004-05-05 03:58:44 +02:00
|
|
|
AC_CONFIG_FILES(Makefile src/Makefile tests/Makefile tests/check-namespace.sh
|
2003-01-17 08:48:52 +01:00
|
|
|
doc/Makefile doc/common.tex)
|
|
|
|
AC_OUTPUT
|