dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.13) AC_INIT(machine/defs.h) AM_CONFIG_HEADER(config.h) . $srcdir/VERSION AC_CANONICAL_SYSTEM AC_VALIDATE_CACHED_SYSTEM_TUPLE( rm -f $cache_file echo Please rerun configure exit 1 ) AM_INIT_AUTOMAKE(crashecho, $VERSION) AC_DEFINE_UNQUOTED(VERSION_MAJOR, $VERSION_MAJOR, [Major version]) AC_DEFINE_UNQUOTED(VERSION_MINOR, $VERSION_MINOR, [Minor version]) AC_DEFINE_UNQUOTED(VERSION_PATCH, "$VERSION_PATCH", [Patchlevel]) CFLAGS="$CFLAGS -D_BSD_SOURCE -D_GNU_SOURCE" #-------------------------------------------------------------------- # specific target_os options #-------------------------------------------------------------------- case "$host_os" in mingw32*) if test "$host" != "$build"; then case "$build_os" in cygwin*) CFLAGS="$CFLAGS -mno-cygwin -mconsole" CPPFLAGS="$CPPFLAGS $CFLAGS" ;; *) CC="$host_cpu-$host_os-gcc" AS="$CC" AR="$host_cpu-$host_os-ar" RANLIB="$host_cpu-$host_os-ranlib" ;; esac fi ;; freebsd*) CFLAGS="$CFLAGS -I/usr/local/include" CPPFLAGS="$CPPFLAGS $CFLAGS" LIBS="$LIBS -L/usr/local/lib" ;; esac dnl Checks for programs. AC_PROG_AWK AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(string.h syslog.h unistd.h getopt.h errno.h stdarg.h \ fcntl.h sys/stat.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_PID_T AC_TYPE_SIZE_T AC_STRUCT_TM AC_MSG_CHECKING(for uchar in sys/types.h) AC_TRY_COMPILE( [#include ], [ uchar x = 0;], AC_DEFINE(HAVE_UCHAR, 1, [Define this if you have `uchar' in sys/types.h]) AC_MSG_RESULT(yes), AC_MSG_RESULT(no) ) AC_MSG_CHECKING(for ushort in sys/types.h) AC_TRY_COMPILE( [#include ], [ ushort x = 0;], AC_DEFINE(HAVE_USHORT, 1, [Define this if you have `ushort' in sys/types.h]) AC_MSG_RESULT(yes), AC_MSG_RESULT(no) ) AC_MSG_CHECKING(for ulong in sys/types.h) AC_TRY_COMPILE( [#include ], [ ulong x = 0;], AC_DEFINE(HAVE_ULONG, 1, [Define this if you have `ulong' in sys/types.h]) AC_MSG_RESULT(yes), AC_MSG_RESULT(no) ) AC_MSG_CHECKING(for bool in sys/types.h) AC_TRY_COMPILE( [#include ], [ bool x = 0;], AC_DEFINE(HAVE_BOOL, 1, [Define this if you have `bool' in sys/types.h]) AC_MSG_RESULT(yes), AC_MSG_RESULT(no) ) dnl Checks for library functions. AC_FUNC_FNMATCH_GNU AC_TYPE_SIGNAL AC_FUNC_STRFTIME AC_FUNC_VPRINTF AC_CHECK_FUNCS(getcwd mkdir mktime strerror \ strcasecmp strncasecmp stricmp strnicmp) dnl Config file AC_MSG_CHECKING([for config path]) AC_ARG_WITH(config, [ --with-config specifies config path ], , with_config=NONE) if test "x${with_config}" = xNONE; then case "$host_os" in mingw32*) with_config="crashecho.conf" ;; *) if test "x${prefix}" = xNONE; then with_config="${ac_default_prefix}/etc/ftn/crashecho.conf" else with_config="${prefix}/etc/ftn/crashecho.conf" fi ;; esac fi AC_DEFINE_UNQUOTED(CONFIG_NAME, "$with_config", [Default config name]) AC_MSG_RESULT($with_config) CONFIG_NAME=$with_config AC_SUBST(CONFIG_NAME) dnl JAM support AC_ARG_WITH(jamlib, [ --with-jamlib[=DIR] use jamlib found in DIR], HAVE_JAM=$withval, HAVE_JAM=auto) if test "x$HAVE_JAM" != xno; then if test "x$HAVE_JAM" != xauto; then JAM_CFLAGS="$JAM_CFLAGS -I$withval/include" JAM_LIBS="$JAM_LIBS -L$withval/lib" dnl The default system location is /usr/include or /usr/local/include dnl and we (obviously) do not need to set CFLAGS for that fi save_CFLAGS="$CFLAGS" save_CPPFLAGS="$CPPFLAGS" CFLAGS="$CFLAGS $JAM_CFLAGS" CPPFLAGS="$CPPFLAGS $CFLAGS" AC_CHECK_HEADER(jamlib/jam.h, HAVE_JAM=yes, HAVE_JAM=no) CFLAGS="$save_CFLAGS" CFLAGS="$save_CPPLAGS" dnl Make sure -ljam works if test "x$HAVE_JAM" = xyes; then AC_CHECK_LIB(jam, JAM_OpenMB, JAM_LIBS="$JAM_LIBS -ljam" HAVE_JAM=yes, HAVE_JAM=no, [$JAM_LIBS]) fi if test "x$HAVE_JAM" != xyes; then JAM_CFLAGS="" JAM_LIBS="" fi fi AC_MSG_CHECKING(for JAM support) AC_ARG_ENABLE(jam, [ --disable-jam disable JAM messagebase support ], , enable_jam=yes) if test "x$enable_jam" != xno; then if test "x$HAVE_JAM" = xyes; then AC_DEFINE(MSGBASE_JAM, 1, [Define if you have jamlib installed and want to use JAM messagebases]) AC_MSG_RESULT(yes) else AC_MSG_RESULT([no (jamlib not found)]) fi else AC_MSG_RESULT(no) JAM_CFLAGS="" JAM_LIBS="" fi AC_SUBST(JAM_CFLAGS) AC_SUBST(JAM_LIBS) dnl syslog support AC_MSG_CHECKING(for syslog support) AC_ARG_ENABLE(syslog, [ --disable-syslog disable syslog support ], , enable_syslog=yes) if test "x$enable_syslog" != xno; then if test x$ac_cv_header_syslog_h = xyes; then AC_DEFINE(USE_SYSLOG, 1, [Define if you want to use syslog for logging]) AC_MSG_RESULT(yes) else AC_MSG_RESULT([no (syslog.h not found)]) fi else AC_MSG_RESULT(no) fi AC_OUTPUT([ doc/crashecho.1 doc/crashecho.conf.5 doc/Makefile machine/Makefile shared/Makefile src/Makefile Makefile ])