dnl Process this file with autoconf to produce a configure script. AC_REVISION([$Revision: 1.53 $])dnl AC_INIT(memcheck, 0.2.4, hald@kc.rr.com)dnl AC_CONFIG_SRCDIR(memcheck.h)dnl AC_CANONICAL_TARGET AM_INIT_AUTOMAKE(memcheck, 0.2.4)dnl AM_CONFIG_HEADER(config.h)dnl dnl AC_ARG_ENABLE(warnings,dnl [AC_HELP_STRING(--enable-warnings, [Compiler warnings])])dnl AC_ARG_ENABLE(aggressive-warn,dnl [AC_HELP_STRING(--enable-aggressive-warn,dnl [Aggressive compiler warnings])],dnl enable_warnings=yes)dnl dnl DESCRIPTION=["Memory allocation checker"] AC_DEFINE_UNQUOTED(DESCRIPTION, "$DESCRIPTION", [Description of package])dnl abi_cur=2 abi_rev=4 abi_age=2 abi_full=${abi_cur}:${abi_rev}:${abi_age} AC_SUBST(abi_full)dnl AC_SUBST(libmemcheck_la_LDFLAGS, ["-version-info ${abi_full}"])dnl dnl Checks for programs. AC_PROG_AWK AC_PROG_CC AC_PROG_CPP CF_PROG_CC_CPLUSPLUS if test "${enable_warnings}" = yes; then CF_GCC_WARNINGS fi AC_PROG_LN_S AM_PROG_LIBTOOL AC_SUBST(LIBTOOL_DEPS)dnl dnl case ${build_os} in aix* ) CPPFLAGS="-D_ALL_SOURCE" ;; hpux* ) CPPFLAGS="-D_HPUX_SOURCE" ;; linux* ) CPPFLAGS="-D_GNU_SOURCE" ;; irix* ) CPPFLAGS="-D_SGI_SOURCE -D_KMEMUSER" ;; osf5* ) CPPFLAGS="-D_OSF_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_LIBC_POLLUTION_H_" ;; osf* ) CPPFLAGS="-D_OSF_SOURCE -D_XOPEN_SOURCE_EXTENDED" ;; solaris* ) CPPFLAGS="-D__EXTENSIONS__" ;; * ) CPPFLAGS="" ;; esac dnl dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([stdarg.h vararg.h], break)dnl AC_CHECK_HEADERS([string.h strings.h memory.h], break)dnl AC_CHECK_HEADERS([errno.h fcntl.h limits.h malloc.h setjmp.h stdlib.h signal.h sys/mman.h sys/stat.h sys/types.h unistd.h])dnl AC_CHECK_HEADERS([sys/reg.h])dnl AC_CHECK_HEADERS([pthread.h])dnl AC_CHECK_HEADERS([sys/param.h], , , [ #ifdef HAVE_SYS_PARAM_H # include #endif])dnl AC_CHECK_HEADERS([sys/user.h], , , [ #ifdef HAVE_SYS_REG_H # include #endif #ifdef HAVE_SYS_PARAM_H # include #endif])dnl AC_CHECK_HEADERS([ucontext.h], , , [ #ifdef HAVE_SIGNAL_H # include #endif #ifdef HAVE_SYS_REG_H # include #endif #ifdef HAVE_SYS_PARAM_H # include #endif #ifdef HAVE_SYS_USER_H # include #endif])dnl AC_CHECK_HEADERS([execinfo.h])dnl dnl dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T AC_TYPE_SIGNAL AC_CHECK_TYPES(caddr_t, , , [#include ])dnl AC_CHECK_TYPES([sigjmp_buf], , AC_CHECK_TYPES([jmp_buf], , , [#ifdef HAVE_SETJMP_H # include #endif]), [#ifdef HAVE_SETJMP_H # include #endif])dnl AC_CHECK_TYPES(sig_atomic_t, , AC_DEFINE(sig_atomic_t, int, [Define to int if signal.h doesn't define]), [#ifdef HAVE_SIGNAL_H # include #endif])dnl AC_CHECK_TYPES([pthread_mutex_t], , , [#ifdef HAVE_PTHREAD_H # include #endif ])dnl AC_CHECK_TYPES([ucontext_t], , , [#ifdef HAVE_SIGNAL_H # include #endif #ifdef HAVE_SYS_REG_H # include #endif #ifdef HAVE_SYS_PARAM_H # include #endif #ifdef HAVE_SYS_USER_H # include #endif #ifdef HAVE_UCONTEXT_H # include #endif])dnl AC_CHECK_TYPES([sigcontext_t], , AC_CHECK_TYPES([struct sigcontext], AC_DEFINE(sigcontext_t, [struct sigcontext], [Define to struct sigcontext if signal.h doesn't define]), , [#ifdef HAVE_SIGNAL_H # include #endif]), [#ifdef HAVE_SIGNAL_H # include #endif])dnl AC_CHECK_TYPES([sigaction_t], , AC_CHECK_TYPES([struct sigaction], AC_DEFINE(sigaction_t, [struct sigaction], [Define to struct sigaction if signal.h doesn't define]), , [#ifdef HAVE_SIGNAL_H # include #endif]), [#ifdef HAVE_SIGNAL_H # include #endif])dnl AC_CHECK_TYPES([siginfo_t], , , [#ifdef HAVE_SIGNAL_H # include #endif])dnl if test "${ac_cv_type_sigaction_t}" = yes then AC_CHECK_MEMBERS([sigaction_t.sa_sigaction], , AC_CHECK_MEMBERS([sigaction_t.sa_handler], , , [#ifdef HAVE_SIGNAL_H # include #endif]), [#ifdef HAVE_SIGNAL_H # include #endif])dnl fi if test "${ac_cv_type_struct_sigaction}" = yes then AC_CHECK_MEMBERS([struct sigaction.sa_sigaction], , AC_CHECK_MEMBERS([struct sigaction.sa_handler], , , [#ifdef HAVE_SIGNAL_H # include #endif]), [#ifdef HAVE_SIGNAL_H # include #endif])dnl fi if test "${ac_cv_type_siginfo_t}" = yes then AC_CHECK_MEMBERS([siginfo_t.si_addr], , , [#ifdef HAVE_SIGNAL_H # include #endif])dnl AC_CHECK_MEMBERS([siginfo_t.si_ptr], , , [#ifdef HAVE_SIGNAL_H # include #endif])dnl fi if test "${ac_cv_type_ucontext_t}" = yes then AC_CHECK_MEMBERS([ucontext_t.uc_mcontext.sc_ip, ucontext_t.uc_mcontext.sc_pc, ucontext_t.uc_mcontext.rip, ucontext_t.uc_mcontext.eip, ucontext_t.uc_mcontext.mc_rip, ucontext_t.uc_mcontext.mc_eip, ucontext_t.uc_mcontext.mc_err, ucontext_t.uc_mcontext.arm_pc, ucontext_t.uc_mcontext.gr8, ucontext_t.uc_mcontext.sc, ucontext_t.uc_mcontext.gregs, ucontext_t.uc_mcontext.sc_regs, ucontext_t.uc_mcontext.mc_regs, ucontext_t.uc_mcontext.sc_traparg_a0, ucontext_t.uc_mcontext.cr2, ucontext_t.uc_mcontext.fault_address, ucontext_t.uc_mcontext->ss.srr0, ucontext_t.uc_mcontext->es.dar, ucontext_t.uc_mcontext.psw], , , [#ifdef HAVE_SIGNAL_H # include #endif #ifdef HAVE_SYS_REG_H # include #endif #ifdef HAVE_SYS_PARAM_H # include #endif #ifdef HAVE_SYS_USER_H # include #endif #if defined(__x86_64__) && defined(__linux__) # include "x86_64-ucontext.h" #else # if (defined(__arm) || defined(__arm__)) && defined(__linux__) # include "arm-ucontext.h" # else # ifdef HAVE_UCONTEXT_H # include # endif # endif #endif])dnl fi if test "${ac_cv_type_sigcontext_t}" = yes then AC_CHECK_MEMBERS([sigcontext_t.sc_pc, sigcontext_t.sigc_pc, sigcontext_t.sc_ir, sigcontext_t.sc_rip, sigcontext_t.sc_eip, sigcontext_t.sc_jmpbuf, sigcontext_t.sc_regs, sigcontext_t.sregs, sigcontext_t.eip, sigcontext_t.rip, sigcontext_t.arm_pc, sigcontext_t.sc_traparg_a0, sigcontext_t.fault_address, sigcontext_t.cr2], , , [#ifdef HAVE_SIGNAL_H # include #endif])dnl fi if test "${ac_cv_type_struct_sigcontext}" = yes then AC_CHECK_MEMBERS([struct sigcontext.sc_pc, struct sigcontext.sigc_pc, struct sigcontext.sc_ir, struct sigcontext.sc_rip, struct sigcontext.sc_eip, struct sigcontext.sc_jmpbuf, struct sigcontext.sc_regs, struct sigcontext.sregs, struct sigcontext.eip, struct sigcontext.rip, struct sigcontext.arm_pc, struct sigcontext.sc_traparg_a0, struct sigcontext.fault_address, struct sigcontext.cr2], , , [#ifdef HAVE_SIGNAL_H # include #endif])dnl fi dnl dnl For STACK_DIRECTION. _AC_LIBOBJ_ALLOCA CF_STACK_ORDER dnl Checks for libraries. AC_SEARCH_LIBS([__uc_get_ip], [uca])dnl dnl Checks for library functions. AC_FUNC_MMAP AC_CHECK_FUNCS([fsync])dnl AC_CHECK_FUNCS([memcpy bcopy], break)dnl AC_CHECK_FUNCS([siglongjmp longjmp], break)dnl AC_CHECK_FUNCS([perror strerror sys_errlist _sys_errlist], break)dnl AC_CHECK_FUNCS([psignal strsignal sys_siglist _sys_siglist], break)dnl AC_CHECK_FUNCS([sigaction])dnl AC_CHECK_FUNCS([atexit getpagesize memmove memset strdup])dnl dnl AC_CHECK_FUNCS([backtrace])dnl AC_CHECK_FUNCS([pthread_mutex_init pthread_mutex_lock pthread_mutex_unlock pthread_mutex_destroy])dnl AC_CHECK_FUNCS([__uc_get_ip])dnl AC_CHECK_DECLS([errno], , , [#ifdef HAVE_ERRNO_H # INCLUDE #endif])dnl No, it's not a function, but . . . if test "${enable_warnings}" = yes; then CFLAGS="${CFLAGS} ${EXTRA_CFLAGS}" EXTRA_CFLAGS= fi AC_CONFIG_FILES(Makefile)dnl AC_OUTPUT