AC_PREREQ(2.57) AC_COPYRIGHT([(c) Copyright 2003-2005 Matt Messier and John Viega]) AC_INIT([safestr], [1.0.3], [safestr@zork.org]) AM_INIT_AUTOMAKE([1.7 foreign]) AM_CONFIG_HEADER([config.h safestr.h]) AC_CONFIG_SRCDIR([safestr.h.in]) AC_CONFIG_AUX_DIR(.) AC_PREFIX_DEFAULT([/usr/local]) dnl When you change this version number here, make sure that you also change dnl the AC_CONFIG_SUBDIRS at the bottom of the file. Unfortunately, shell dnl variables cannot be used in AC_CONFIG_SUBDIRS, so you have to change the dnl version number in two locations rather than just one. dnl dnl Additionally, you must also change XXL_SUBDIR in Makefile.am. It does not dnl use XXL_VERSION even though it is available and works because automake will dnl generate an error because it can't find the directory xxl-$(XXL_VERSION) dnl without expanding the macro. XXL_VERSION="1.0.1" AC_SUBST(XXL_VERSION) SAFESTR_VERSION_CURRENT=3 SAFESTR_VERSION_REVISION=0 SAFESTR_VERSION_AGE=1 AC_SUBST(SAFESTR_VERSION_CURRENT) AC_SUBST(SAFESTR_VERSION_REVISION) AC_SUBST(SAFESTR_VERSION_AGE) AC_ARG_ENABLE([debug], [ --enable-debug build with debugging code enabled], [if test "$enablevar" != "no"; then AC_MSG_NOTICE([Building with debugging code enabled.]) CFLAGS="$CFLAGS -g" CPPFLAGS="$CPPFLAGS -D_DEBUG" fi]) AC_ARG_ENABLE([profile], [ --enable-profile build with profiling code enabled], [if test "$enablevar" != "no"; then AC_MSG_NOTICE([Building with profiling code enabled.]) CFLAGS="$CFLAGS -pg" CPPFLAGS="$CPPFLAGS -D_DEBUG" LDFLAGS="$LDFLAGS -pg" fi]) AC_ARG_WITH([xxl], [ --with-xxl[[=path]] specify the path where XXL is installed], [ac_arg_with_xxl="$withval"], [ac_arg_with_xxl="/usr/local"]) if test "$ac_arg_with_xxl" = "no"; then AC_MSG_ERROR([XXL is REQUIRED. You CANNOT disable it.]) fi CPPFLAGS="$CPPFLAGS -I$ac_arg_with_xxl/include" LDFLAGS="$LDFLAGS -L$ac_arg_with_xxl/lib" AC_PROG_CC AC_PROG_LIBTOOL AC_SUBST(LIBTOOL_DEPS) AC_PROG_LN_S ACX_PTHREAD CC="$PTHREAD_CC" LIBS="$LIBS $PTHREAD_LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" ac_build_xxl=no AC_CHECK_LIB(xxl, xxl_release_asset, [], [ ac_build_xxl=yes AC_MSG_NOTICE([XXL was not found. The version included in this distribution will be built.]) ]) AM_CONDITIONAL([BUILD_XXL], [test "${ac_build_xxl}" = "yes"]) AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h limits.h stdint.h termios.h signal.h paths.h) if test "${ac_build_xxl}" = "no"; then AC_CHECK_HEADERS(xxl.h, [], [AC_MSG_ERROR([Unable to locate xxl.h. You may need to use --with-xxl to specify where you have it installed.])]) fi AC_TYPE_SIZE_T AC_CHECK_TYPES(long double) AC_CHECK_TYPES(int32_t) AC_CHECK_TYPES(int64_t) AC_CHECK_TYPES(u_int32_t) AC_CHECK_TYPES(u_int64_t) AC_CHECK_TYPES(ssize_t) AC_CHECK_TYPES(intmax_t) AC_CHECK_TYPES(uintmax_t) AC_CHECK_TYPES(ptrdiff_t) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(__int64) AC_CHECK_SIZEOF(long long) AC_CHECK_SIZEOF(void *) AC_CHECK_SIZEOF(size_t) AC_C_CONST AC_C_VOLATILE if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall" GOOD_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wno-long-double" AC_TRY_COMPILE([],[],[],[CFLAGS="$GOOD_CFLAGS"]) fi ACX_C99_TYPES dnl We have to make a best guess here because we can't be guaranteed that dnl $prefix exists yet, and even if it does, chances are good that we can't dnl write to it. Also, there's no real portable way to transform a string from dnl uppercase to lowercase or vice versa. AC_MSG_CHECKING([if filesystem is case-sensitive]) if test -f $srcdir/SaFeStR.C; then AC_MSG_RESULT([no]) FSCASESENSITIVE="no" else AC_MSG_RESULT([yes]) FSCASESENSITIVE="yes" fi AC_SUBST(FSCASESENSITIVE) if test "${ac_build_xxl}" = "yes"; then CPPFLAGS="-Ixxl-${XXL_VERSION} $CPPFLAGS" LDFLAGS="-Lxxl-${XXL_VERSION} $LDFLAGS" LIBS="$LIBS -lxxl" fi AC_CONFIG_FILES([Makefile], [chmod -w Makefile]) AC_CONFIG_SUBDIRS([xxl-1.0.1]) AC_OUTPUT