2011-08-16 06:02:26 +02:00
define(pkg_major, 1)
2017-11-23 01:24:02 +01:00
define(pkg_minor, 3)
define(pkg_extra, -rc1)
2007-11-15 00:47:28 +01:00
define(pkg_maintainer, libunwind-devel@nongnu.org)
2004-09-08 19:36:28 +02:00
define(mkvers, $1.$2$3)
2002-02-28 17:24:48 +01:00
dnl Process this file with autoconf to produce a configure script.
2012-08-02 10:00:15 +02:00
AC_INIT([libunwind],[mkvers(pkg_major, pkg_minor, pkg_extra)],[pkg_maintainer])
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)
2012-08-02 10:00:15 +02:00
AC_CANONICAL_TARGET
2004-08-17 17:34:28 +02:00
AM_INIT_AUTOMAKE([1.6 subdir-objects])
2002-02-28 17:24:48 +01:00
AM_MAINTAINER_MODE
2012-08-02 10:00:15 +02:00
AC_CONFIG_HEADERS([include/config.h])
2002-02-28 17:24:48 +01:00
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
2017-02-02 17:47:19 +01:00
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
2012-08-02 10:00:15 +02:00
LT_INIT
2003-02-14 04:09:27 +01:00
AM_PROG_AS
2004-08-17 17:34:28 +02:00
AM_PROG_CC_C_O
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)
2010-03-07 11:46:05 +01:00
OLD_LIBS=${LIBS}
2010-03-31 22:01:46 +02:00
AC_SEARCH_LIBS(dlopen, dl)
2010-03-07 11:46:05 +01:00
LIBS=${OLD_LIBS}
case "$ac_cv_search_dlopen" in
-l*) DLLIB=$ac_cv_search_dlopen;;
*) DLLIB="";;
esac
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
2010-03-05 23:41:37 +01:00
AC_CHECK_HEADERS(asm/ptrace_offsets.h endian.h sys/endian.h execinfo.h \
2010-03-06 13:55:11 +01:00
ia64intrin.h sys/uc_access.h unistd.h signal.h sys/types.h \
Add basic support for the QNX operating system
This change adds some special cases to allow libunwind to compile
for QNX.
* QNX's copy of <elf.h> and <link.h> reside in sys/ instead. To deal
with this, an AC_CHECK_HEADERS() was added to check for the files
in both locations.
* Similarly, QNX does not have <endian.h>. In cases where the file is
not found, logic was added to refer to QNX-specific macros to determine
endianness.
* The QCC compiler, which is a wrapper around GCC, cannot handle some
standard GCC options. Therefore, logic was added to check for QCC,
and when it is found, to suppress the use of -lgcc, and to express the
option -nostartfiles as -Wc,-nostartfiles instead, which is correctly
passed on to the underlying GCC.
* Finally, the support file os-qnx.c was added, patterned after the existing
os-*.c files. Only local image lookup is currently supported (see the
comments for more information), but this is sufficient for QNX, since
ptrace is not supported there anyway, and that is the only case where the
function is required to do remote image lookup.
Change-Id: Ie7934f94a7317bdde59335f2acd4c3a97c0384c1
2013-04-15 16:53:29 +02:00
sys/procfs.h sys/ptrace.h byteswap.h elf.h sys/elf.h link.h sys/link.h)
2002-02-28 17:24:48 +01:00
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
2012-03-13 02:46:57 +01:00
AC_CHECK_SIZEOF(off_t)
2002-02-28 17:24:48 +01:00
2003-09-25 07:29:14 +02:00
CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"
2004-01-24 07:45:18 +01:00
AC_CHECK_MEMBERS([struct dl_phdr_info.dlpi_subs],,,[#include <link.h>])
2012-03-13 13:01:21 +01:00
AC_CHECK_TYPES([struct elf_prstatus, struct prstatus], [], [],
[$ac_includes_default
#if HAVE_SYS_PROCFS_H
# include <sys/procfs.h>
#endif
])
2003-03-19 20:25:18 +01:00
2017-08-07 18:32:27 +02:00
AC_CHECK_DECLS([PTRACE_POKEUSER, PTRACE_POKEDATA, PTRACE_SETREGSET,
2010-10-25 18:52:55 +02:00
PTRACE_TRACEME, PTRACE_CONT, PTRACE_SINGLESTEP,
2010-04-05 22:19:03 +02:00
PTRACE_SYSCALL, PT_IO, PT_GETREGS,
PT_GETFPREGS, PT_CONTINUE, PT_TRACE_ME,
PT_STEP, PT_SYSCALL], [], [],
2010-03-07 23:50:50 +01:00
[$ac_includes_default
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <sys/ptrace.h>
])
2010-03-06 13:55:11 +01:00
2002-02-28 17:24:48 +01:00
dnl Checks for library functions.
2004-04-20 18:53:44 +02:00
AC_CHECK_FUNCS(dl_iterate_phdr dl_phdr_removals_counter dlmodinfo getunwind \
2010-04-20 16:45:18 +02:00
ttrace mincore)
2002-02-28 17:24:48 +01:00
2010-10-29 01:25:49 +02:00
AC_MSG_CHECKING([if building with AltiVec])
2012-09-15 02:11:49 +02:00
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#ifndef __ALTIVEC__
# error choke
#endif
]])], [use_altivec=yes],[use_altivec=no])
AM_CONDITIONAL(USE_ALTIVEC, [test x$use_altivec = xyes])
AC_MSG_RESULT([$use_altivec])
2007-08-07 04:23:42 +02:00
2012-09-15 02:11:46 +02:00
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#ifndef __powerpc64__
# error choke
#endif
]])], [ppc_bits=64], [ppc_bits=32])
2012-09-15 02:11:53 +02:00
AC_DEFUN([SET_ARCH],[
AS_CASE([$1],
2014-12-04 02:35:43 +01:00
[aarch64*],[$2=aarch64],
2012-09-15 02:11:53 +02:00
[arm*],[$2=arm],
[i?86],[$2=x86],
[hppa*],[$2=hppa],
[mips*],[$2=mips],
[powerpc*],[$2=ppc$ppc_bits],
2012-08-16 12:10:29 +02:00
[sh*],[$2=sh],
2012-09-15 02:11:53 +02:00
[amd64],[$2=x86_64],
2014-09-02 23:35:41 +02:00
[tile*],[$2=tilegx],
2012-09-15 02:11:53 +02:00
[$2=$1])
]) dnl SET_ARCH
SET_ARCH([$build_cpu],[build_arch])
SET_ARCH([$host_cpu],[host_arch])
SET_ARCH([$target_cpu],[target_arch])
2002-02-28 17:24:48 +01:00
2017-03-04 20:48:24 +01:00
# Check for Android
AC_MSG_CHECKING([for Android])
android="no"
case "$host_os" in
*android*)
android="yes"
AC_MSG_RESULT([yes])
;;
*)
AC_MSG_RESULT([no])
;;
esac
2012-09-15 02:11:50 +02:00
AC_ARG_ENABLE(coredump,
2012-09-15 02:11:55 +02:00
AS_HELP_STRING([--enable-coredump],[building libunwind-coredump library]),,
2014-09-02 23:35:41 +02:00
[AS_CASE([$host_arch], [aarch64*|arm*|mips*|sh*|x86*|tile*], [enable_coredump=yes], [enable_coredump=no])]
2012-09-15 02:11:50 +02:00
)
AC_MSG_CHECKING([if we should build libunwind-coredump])
AC_MSG_RESULT([$enable_coredump])
2013-04-15 16:44:48 +02:00
AC_ARG_ENABLE(ptrace,
AS_HELP_STRING([--enable-ptrace],[building libunwind-ptrace library]),,
[AC_CHECK_HEADER([sys/ptrace.h], [enable_ptrace=yes], [enable_ptrace=no])]
)
AC_MSG_CHECKING([if we should build libunwind-ptrace])
AC_MSG_RESULT([$enable_ptrace])
2013-04-19 01:32:53 +02:00
AC_ARG_ENABLE(setjmp,
AS_HELP_STRING([--enable-setjmp],[building libunwind-setjmp library]),,
[AS_IF([test x$target_arch == x$host_arch], [enable_setjmp=yes], [enable_setjmp=no])]
)
2014-12-02 13:30:24 +01:00
AC_ARG_ENABLE(documentation,
AS_HELP_STRING([--disable-documentation],[Disable generating the man pages]),,
[enable_documentation=yes])
2016-05-11 21:48:55 +02:00
AC_ARG_ENABLE(tests,
AS_HELP_STRING([--disable-tests],[Disable tests build]),,
[enable_tests=yes])
2013-04-19 01:32:53 +02:00
AC_MSG_CHECKING([if we should build libunwind-setjmp])
AC_MSG_RESULT([$enable_setjmp])
2010-10-29 01:25:49 +02:00
AC_MSG_CHECKING([for build architecture])
AC_MSG_RESULT([$build_arch])
AC_MSG_CHECKING([for host architecture])
AC_MSG_RESULT([$host_arch])
AC_MSG_CHECKING([for target architecture])
AC_MSG_RESULT([$target_arch])
AC_MSG_CHECKING([for target operating system])
AC_MSG_RESULT([$target_os])
2012-09-15 02:11:50 +02:00
AM_CONDITIONAL(BUILD_COREDUMP, test x$enable_coredump = xyes)
2013-04-15 16:44:48 +02:00
AM_CONDITIONAL(BUILD_PTRACE, test x$enable_ptrace = xyes)
2013-04-19 01:32:53 +02:00
AM_CONDITIONAL(BUILD_SETJMP, test x$enable_setjmp = xyes)
2017-08-17 23:13:28 +02:00
AM_CONDITIONAL(NO_PTRACE_TEST, test x$build_arch != x$host_arch)
2008-02-05 01:16:37 +01:00
AM_CONDITIONAL(REMOTE_ONLY, test x$target_arch != x$host_arch)
2013-05-11 17:18:23 +02:00
AM_CONDITIONAL(ARCH_AARCH64, test x$target_arch = xaarch64)
2008-02-05 01:16:37 +01:00
AM_CONDITIONAL(ARCH_ARM, test x$target_arch = xarm)
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)
2008-02-05 01:16:37 +01:00
AM_CONDITIONAL(ARCH_MIPS, test x$target_arch = xmips)
2003-01-16 04:10:11 +01:00
AM_CONDITIONAL(ARCH_X86, test x$target_arch = xx86)
2004-08-19 15:39:10 +02:00
AM_CONDITIONAL(ARCH_X86_64, test x$target_arch = xx86_64)
2007-08-02 17:59:43 +02:00
AM_CONDITIONAL(ARCH_PPC32, test x$target_arch = xppc32)
AM_CONDITIONAL(ARCH_PPC64, test x$target_arch = xppc64)
2012-08-16 12:10:29 +02:00
AM_CONDITIONAL(ARCH_SH, test x$target_arch = xsh)
2014-09-02 23:35:41 +02:00
AM_CONDITIONAL(ARCH_TILEGX, test x$target_arch = xtilegx)
2017-12-05 16:05:41 +01:00
AM_CONDITIONAL(ARCH_S390X, test x$target_arch = xs390x)
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)
2010-03-05 23:41:37 +01:00
AM_CONDITIONAL(OS_FREEBSD, expr x$target_os : xfreebsd >/dev/null)
Add basic support for the QNX operating system
This change adds some special cases to allow libunwind to compile
for QNX.
* QNX's copy of <elf.h> and <link.h> reside in sys/ instead. To deal
with this, an AC_CHECK_HEADERS() was added to check for the files
in both locations.
* Similarly, QNX does not have <endian.h>. In cases where the file is
not found, logic was added to refer to QNX-specific macros to determine
endianness.
* The QCC compiler, which is a wrapper around GCC, cannot handle some
standard GCC options. Therefore, logic was added to check for QCC,
and when it is found, to suppress the use of -lgcc, and to express the
option -nostartfiles as -Wc,-nostartfiles instead, which is correctly
passed on to the underlying GCC.
* Finally, the support file os-qnx.c was added, patterned after the existing
os-*.c files. Only local image lookup is currently supported (see the
comments for more information), but this is sufficient for QNX, since
ptrace is not supported there anyway, and that is the only case where the
function is required to do remote image lookup.
Change-Id: Ie7934f94a7317bdde59335f2acd4c3a97c0384c1
2013-04-15 16:53:29 +02:00
AM_CONDITIONAL(OS_QNX, expr x$target_os : xnto-qnx >/dev/null)
2002-02-28 17:24:48 +01:00
2010-11-09 02:16:40 +01:00
AC_MSG_CHECKING([for ELF helper width])
case "${target_arch}" in
2012-08-16 12:10:29 +02:00
(arm|hppa|ppc32|x86|sh) use_elf32=yes; AC_MSG_RESULT([32]);;
2017-12-05 16:05:41 +01:00
(aarch64|ia64|ppc64|x86_64|s390x|tilegx) use_elf64=yes; AC_MSG_RESULT([64]);;
2010-11-09 02:16:40 +01:00
(mips) use_elfxx=yes; AC_MSG_RESULT([xx]);;
*) AC_MSG_ERROR([Unknown ELF target: ${target_arch}])
esac
AM_CONDITIONAL(USE_ELF32, [test x$use_elf32 = xyes])
AM_CONDITIONAL(USE_ELF64, [test x$use_elf64 = xyes])
AM_CONDITIONAL(USE_ELFXX, [test x$use_elfxx = xyes])
2010-11-09 02:16:38 +01:00
AC_MSG_CHECKING([whether to include DWARF support])
if test x$target_arch != xia64; then
use_dwarf=yes
else
use_dwarf=no
fi
AM_CONDITIONAL(USE_DWARF, [test x$use_dwarf = xyes])
AC_MSG_RESULT([$use_dwarf])
2007-09-20 19:11:37 +02:00
if test x$target_arch = xppc64; then
libdir='${exec_prefix}/lib64'
AC_MSG_NOTICE([PowerPC64 detected, lib will be installed ${libdir}]);
AC_SUBST([libdir])
fi
2010-10-29 01:25:49 +02:00
AC_MSG_CHECKING([whether to restrict build to remote support])
2008-02-05 01:16:37 +01:00
if test x$target_arch != x$host_arch; then
2002-02-28 17:24:48 +01:00
CPPFLAGS="${CPPFLAGS} -DUNW_REMOTE_ONLY"
2010-10-29 01:25:49 +02:00
remote_only=yes
else
remote_only=no
2002-02-28 17:24:48 +01:00
fi
2010-10-29 01:25:49 +02:00
AC_MSG_RESULT([$remote_only])
2002-02-28 17:24:48 +01:00
2010-10-29 01:25:49 +02:00
AC_MSG_CHECKING([whether to enable debug support])
2002-02-28 17:24:48 +01:00
AC_ARG_ENABLE(debug,
2012-09-15 02:11:54 +02:00
AS_HELP_STRING([--enable-debug],[turn on debug support (slows down execution)]))
2010-10-29 01:25:49 +02:00
if test x$enable_debug = xyes; then
CPPFLAGS="${CPPFLAGS} -DDEBUG"
else
CPPFLAGS="${CPPFLAGS} -DNDEBUG"
fi
AC_MSG_RESULT([$enable_debug])
2002-02-28 17:24:48 +01:00
2010-10-29 01:25:49 +02:00
AC_MSG_CHECKING([whether to enable C++ exception support])
2008-06-16 22:28:36 +02:00
AC_ARG_ENABLE(cxx_exceptions,
2012-09-15 02:11:55 +02:00
AS_HELP_STRING([--enable-cxx-exceptions],[use libunwind to handle C++ exceptions]),,
2009-03-17 05:57:08 +01:00
[
# C++ exception handling doesn't work too well on x86
case $target_arch in
x86*) enable_cxx_exceptions=no;;
2013-05-11 17:18:23 +02:00
aarch64*) enable_cxx_exceptions=no;;
2009-04-03 00:49:37 +02:00
arm*) enable_cxx_exceptions=no;;
mips*) enable_cxx_exceptions=no;;
2014-09-02 23:35:41 +02:00
tile*) enable_cxx_exceptions=no;;
2009-03-17 05:57:08 +01:00
*) enable_cxx_exceptions=yes;;
esac
])
2008-06-16 22:28:36 +02:00
AM_CONDITIONAL([SUPPORT_CXX_EXCEPTIONS], [test x$enable_cxx_exceptions = xyes])
2010-10-29 01:25:49 +02:00
AC_MSG_RESULT([$enable_cxx_exceptions])
2008-06-16 22:28:36 +02:00
2010-10-29 01:25:49 +02:00
AC_MSG_CHECKING([whether to load .debug_frame sections])
2009-03-17 05:21:58 +01:00
AC_ARG_ENABLE(debug_frame,
2012-09-15 02:11:55 +02:00
AS_HELP_STRING([--enable-debug-frame],[Load the ".debug_frame" section if available]),, [
2010-10-29 01:25:50 +02:00
case "${target_arch}" in
(arm) enable_debug_frame=yes;;
2017-11-20 16:04:11 +01:00
(aarch64) enable_debug_frame=yes;;
2010-10-29 01:25:50 +02:00
(*) enable_debug_frame=no;;
esac])
2009-03-18 03:08:58 +01:00
if test x$enable_debug_frame = xyes; then
AC_DEFINE([CONFIG_DEBUG_FRAME], [], [Enable Debug Frame])
fi
2010-10-29 01:25:49 +02:00
AC_MSG_RESULT([$enable_debug_frame])
2009-03-18 03:08:58 +01:00
2010-10-29 01:25:49 +02:00
AC_MSG_CHECKING([whether to block signals during mutex ops])
2009-09-21 22:04:33 +02:00
AC_ARG_ENABLE(block_signals,
2012-09-15 02:11:55 +02:00
AS_HELP_STRING([--enable-block-signals],[Block signals before performing mutex operations]),,
[enable_block_signals=yes])
2009-09-21 22:04:33 +02:00
if test x$enable_block_signals = xyes; then
AC_DEFINE([CONFIG_BLOCK_SIGNALS], [], [Block signals before mutex operations])
fi
2010-10-29 01:25:49 +02:00
AC_MSG_RESULT([$enable_block_signals])
2009-09-21 22:04:33 +02:00
2010-10-29 01:25:49 +02:00
AC_MSG_CHECKING([whether to validate memory addresses before use])
2010-04-25 04:24:49 +02:00
AC_ARG_ENABLE(conservative_checks,
2012-09-15 02:11:55 +02:00
AS_HELP_STRING([--enable-conservative-checks],[Validate all memory addresses before use]),,
[enable_conservative_checks=yes])
2010-04-25 04:24:49 +02:00
if test x$enable_conservative_checks = xyes; then
2011-03-22 11:30:21 +01:00
AC_DEFINE(CONSERVATIVE_CHECKS, 1,
[Define to 1 if you want every memory access validated])
2010-04-25 04:24:49 +02:00
fi
2010-10-29 01:25:49 +02:00
AC_MSG_RESULT([$enable_conservative_checks])
2009-09-21 22:04:33 +02:00
2011-06-19 05:16:13 +02:00
AC_MSG_CHECKING([whether to enable msabi support])
AC_ARG_ENABLE(msabi_support,
2012-09-15 02:11:54 +02:00
AS_HELP_STRING([--enable-msabi-support],[Enables support for Microsoft ABI extensions]))
2011-06-19 05:16:13 +02:00
if test x$enable_msabi_support = xyes; then
AC_DEFINE([CONFIG_MSABI_SUPPORT], [], [Support for Microsoft ABI extensions])
fi
AC_MSG_RESULT([$enable_msabi_support])
2013-09-05 12:44:41 +02:00
LIBLZMA=
2012-08-08 19:50:10 +02:00
AC_MSG_CHECKING([whether to support LZMA-compressed symbol tables])
AC_ARG_ENABLE(minidebuginfo,
2012-09-15 02:11:55 +02:00
AS_HELP_STRING([--enable-minidebuginfo], [Enables support for LZMA-compressed symbol tables]),, [enable_minidebuginfo=auto])
2012-08-08 19:50:10 +02:00
AC_MSG_RESULT([$enable_minidebuginfo])
if test x$enable_minidebuginfo != xno; then
AC_CHECK_LIB([lzma], [lzma_mf_is_supported],
2013-09-05 12:44:41 +02:00
[LIBLZMA=-llzma
2012-08-08 19:50:10 +02:00
AC_DEFINE([HAVE_LZMA], [1], [Define if you have liblzma])
enable_minidebuginfo=yes],
[if test x$enable_minidebuginfo = xyes; then
AC_MSG_FAILURE([liblzma not found])
fi])
fi
2013-09-05 12:44:41 +02:00
AC_SUBST([LIBLZMA])
2012-08-08 19:50:10 +02:00
AM_CONDITIONAL(HAVE_LZMA, test x$enable_minidebuginfo = xyes)
2017-03-27 10:24:26 +02:00
AC_MSG_CHECKING([whether to support UNW_CACHE_PER_THREAD])
AC_ARG_ENABLE([per-thread-cache],
AS_HELP_STRING([--enable-per-thread-cache], [build with support for UNW_CACHE_PER_THREAD (which imposes a hight TLS memory usage) (default: disabled)]))
AC_MSG_RESULT([$enable_per_thread_cache])
AS_IF([test x$enable_per_thread_cache = xyes], [
LIBUNWIND___THREAD
AS_IF([test x$libc_cv_gcc___thread = xno], [
AC_MSG_FAILURE([UNW_CACHE_PER_THREAD requires __thread])
])
])
2002-11-09 08:59:02 +01:00
2010-10-29 01:25:49 +02:00
AC_MSG_CHECKING([for Intel compiler])
2012-08-02 10:00:15 +02:00
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[#ifndef __INTEL_COMPILER
2004-04-20 18:53:44 +02:00
#error choke me
2012-08-02 10:00:15 +02:00
#endif]])],[intel_compiler=yes],[intel_compiler=no])
2004-04-20 18:53:44 +02:00
if test x$GCC = xyes -a x$intel_compiler != xyes; then
2005-05-03 11:13:17 +02:00
CFLAGS="${CFLAGS} -fexceptions -Wall -Wsign-compare"
2002-07-18 05:58:34 +02:00
fi
2010-10-29 01:25:49 +02:00
AC_MSG_RESULT([$intel_compiler])
2002-07-18 05:58:34 +02:00
Add basic support for the QNX operating system
This change adds some special cases to allow libunwind to compile
for QNX.
* QNX's copy of <elf.h> and <link.h> reside in sys/ instead. To deal
with this, an AC_CHECK_HEADERS() was added to check for the files
in both locations.
* Similarly, QNX does not have <endian.h>. In cases where the file is
not found, logic was added to refer to QNX-specific macros to determine
endianness.
* The QCC compiler, which is a wrapper around GCC, cannot handle some
standard GCC options. Therefore, logic was added to check for QCC,
and when it is found, to suppress the use of -lgcc, and to express the
option -nostartfiles as -Wc,-nostartfiles instead, which is correctly
passed on to the underlying GCC.
* Finally, the support file os-qnx.c was added, patterned after the existing
os-*.c files. Only local image lookup is currently supported (see the
comments for more information), but this is sufficient for QNX, since
ptrace is not supported there anyway, and that is the only case where the
function is required to do remote image lookup.
Change-Id: Ie7934f94a7317bdde59335f2acd4c3a97c0384c1
2013-04-15 16:53:29 +02:00
AC_MSG_CHECKING([for QCC compiler])
AS_CASE([$CC], [qcc*|QCC*], [qcc_compiler=yes], [qcc_compiler=no])
AC_MSG_RESULT([$qcc_compiler])
2010-11-09 02:16:33 +01:00
if test x$intel_compiler = xyes; then
AC_MSG_CHECKING([if linker supports -static-libcxa])
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -static-libcxa"
2012-08-02 10:00:15 +02:00
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[have_static_libcxa=yes],[have_static_libcxa=no])
2010-11-09 02:16:33 +01:00
LDFLAGS="$save_LDFLAGS"
if test "x$have_static_libcxa" = xyes; then
LDFLAGS_STATIC_LIBCXA="-XCClinker -static-libcxa"
fi
AC_MSG_RESULT([$have_static_libcxa])
fi
Add basic support for the QNX operating system
This change adds some special cases to allow libunwind to compile
for QNX.
* QNX's copy of <elf.h> and <link.h> reside in sys/ instead. To deal
with this, an AC_CHECK_HEADERS() was added to check for the files
in both locations.
* Similarly, QNX does not have <endian.h>. In cases where the file is
not found, logic was added to refer to QNX-specific macros to determine
endianness.
* The QCC compiler, which is a wrapper around GCC, cannot handle some
standard GCC options. Therefore, logic was added to check for QCC,
and when it is found, to suppress the use of -lgcc, and to express the
option -nostartfiles as -Wc,-nostartfiles instead, which is correctly
passed on to the underlying GCC.
* Finally, the support file os-qnx.c was added, patterned after the existing
os-*.c files. Only local image lookup is currently supported (see the
comments for more information), but this is sufficient for QNX, since
ptrace is not supported there anyway, and that is the only case where the
function is required to do remote image lookup.
Change-Id: Ie7934f94a7317bdde59335f2acd4c3a97c0384c1
2013-04-15 16:53:29 +02:00
if test x$qcc_compiler = xyes; then
LDFLAGS_NOSTARTFILES="-XCClinker -Wc,-nostartfiles"
else
LDFLAGS_NOSTARTFILES="-XCClinker -nostartfiles"
fi
2017-03-04 20:48:24 +01:00
if test x$GCC = xyes -a x$intel_compiler != xyes -a x$qcc_compiler != xyes -a x$android != xyes; then
2014-06-27 08:40:33 +02:00
LIBCRTS="-lgcc_s"
Add basic support for the QNX operating system
This change adds some special cases to allow libunwind to compile
for QNX.
* QNX's copy of <elf.h> and <link.h> reside in sys/ instead. To deal
with this, an AC_CHECK_HEADERS() was added to check for the files
in both locations.
* Similarly, QNX does not have <endian.h>. In cases where the file is
not found, logic was added to refer to QNX-specific macros to determine
endianness.
* The QCC compiler, which is a wrapper around GCC, cannot handle some
standard GCC options. Therefore, logic was added to check for QCC,
and when it is found, to suppress the use of -lgcc, and to express the
option -nostartfiles as -Wc,-nostartfiles instead, which is correctly
passed on to the underlying GCC.
* Finally, the support file os-qnx.c was added, patterned after the existing
os-*.c files. Only local image lookup is currently supported (see the
comments for more information), but this is sufficient for QNX, since
ptrace is not supported there anyway, and that is the only case where the
function is required to do remote image lookup.
Change-Id: Ie7934f94a7317bdde59335f2acd4c3a97c0384c1
2013-04-15 16:53:29 +02:00
fi
2012-08-30 13:18:33 +02:00
AC_MSG_CHECKING([for __builtin___clear_cache])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[]], [[__builtin___clear_cache(0, 0)]])],
[have__builtin___clear_cache=yes],
[have__builtin___clear_cache=no])
if test x$have__builtin___clear_cache = xyes; then
AC_DEFINE([HAVE__BUILTIN___CLEAR_CACHE], [1],
[Defined if __builtin___clear_cache() is available])
fi
AC_MSG_RESULT([$have__builtin___clear_cache])
2012-11-13 11:19:47 +01:00
AC_MSG_CHECKING([for __builtin_unreachable])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[]], [[__builtin_unreachable()]])],
[have__builtin_unreachable=yes],
[have__builtin_unreachable=no])
if test x$have__builtin_unreachable = xyes; then
AC_DEFINE([HAVE__BUILTIN_UNREACHABLE], [1],
[Defined if __builtin_unreachable() is available])
fi
AC_MSG_RESULT([$have__builtin_unreachable])
2012-09-06 14:42:35 +02:00
AC_MSG_CHECKING([for __sync atomics])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[]], [[
__sync_bool_compare_and_swap((int *)0, 0, 1);
__sync_fetch_and_add((int *)0, 1);
]])],
[have_sync_atomics=yes],
[have_sync_atomics=no])
if test x$have_sync_atomics = xyes; then
AC_DEFINE([HAVE_SYNC_ATOMICS], [1],
[Defined if __sync atomics are available])
fi
AC_MSG_RESULT([$have_sync_atomics])
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-09-08 19:36:28 +02:00
dnl create shell variables from the M4 macros:
PKG_MAJOR=pkg_major
PKG_MINOR=pkg_minor
PKG_EXTRA=pkg_extra
PKG_MAINTAINER=pkg_maintainer
2011-03-22 20:29:40 +01:00
old_LIBS="$LIBS"
LIBS=""
AC_SEARCH_LIBS(backtrace, execinfo)
LIBS="$old_LIBS"
2016-01-31 09:31:04 +01:00
case "$ac_cv_search_backtrace" in
-l*) BACKTRACELIB=$ac_cv_search_backtrace;;
*) BACKTRACELIB="";;
esac
2011-03-22 20:29:40 +01:00
2017-08-17 23:13:28 +02:00
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)
Add basic support for the QNX operating system
This change adds some special cases to allow libunwind to compile
for QNX.
* QNX's copy of <elf.h> and <link.h> reside in sys/ instead. To deal
with this, an AC_CHECK_HEADERS() was added to check for the files
in both locations.
* Similarly, QNX does not have <endian.h>. In cases where the file is
not found, logic was added to refer to QNX-specific macros to determine
endianness.
* The QCC compiler, which is a wrapper around GCC, cannot handle some
standard GCC options. Therefore, logic was added to check for QCC,
and when it is found, to suppress the use of -lgcc, and to express the
option -nostartfiles as -Wc,-nostartfiles instead, which is correctly
passed on to the underlying GCC.
* Finally, the support file os-qnx.c was added, patterned after the existing
os-*.c files. Only local image lookup is currently supported (see the
comments for more information), but this is sufficient for QNX, since
ptrace is not supported there anyway, and that is the only case where the
function is required to do remote image lookup.
Change-Id: Ie7934f94a7317bdde59335f2acd4c3a97c0384c1
2013-04-15 16:53:29 +02:00
AC_SUBST(LDFLAGS_NOSTARTFILES)
2004-11-03 22:50:24 +01:00
AC_SUBST(LIBCRTS)
2004-09-08 19:36:28 +02:00
AC_SUBST(PKG_MAJOR)
AC_SUBST(PKG_MINOR)
AC_SUBST(PKG_EXTRA)
AC_SUBST(PKG_MAINTAINER)
2009-03-16 04:01:23 +01:00
AC_SUBST(enable_cxx_exceptions)
2010-05-27 04:21:30 +02:00
AC_SUBST(enable_debug_frame)
2010-03-07 11:46:05 +01:00
AC_SUBST(DLLIB)
2016-01-31 09:31:04 +01:00
AC_SUBST(BACKTRACELIB)
2003-01-17 08:48:52 +01:00
2014-12-02 13:30:24 +01:00
AC_PATH_PROG([LATEX2MAN],[latex2man])
if test "x$LATEX2MAN" = "x"; then
AC_MSG_WARN([latex2man not found. Install latex2man. Disabling docs.])
enable_documentation="no";
fi
AM_CONDITIONAL([CONFIG_DOCS], [test x$enable_documentation = xyes])
if test "x$enable_documentation" = "xyes"; then
AC_CONFIG_FILES(doc/Makefile doc/common.tex)
fi
2016-05-11 21:48:55 +02:00
AM_CONDITIONAL([CONFIG_TESTS], [test x$enable_tests = xyes])
if test "x$enable_tests" = "xyes"; then
AC_CONFIG_FILES(tests/Makefile tests/check-namespace.sh)
fi
AC_CONFIG_FILES(Makefile src/Makefile
include/libunwind-common.h
2011-11-01 06:21:34 +01:00
include/libunwind.h include/tdep/libunwind_i.h)
2012-09-15 20:09:32 +02:00
AC_CONFIG_FILES(src/unwind/libunwind.pc src/coredump/libunwind-coredump.pc
src/ptrace/libunwind-ptrace.pc src/setjmp/libunwind-setjmp.pc
2012-09-22 07:46:01 +02:00
src/libunwind-generic.pc)
2003-01-17 08:48:52 +01:00
AC_OUTPUT