1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
|
AC_PREREQ(2.59)
AC_INIT(msort, 8.53, billposer@alum.mit.edu)
AM_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE
AC_DEFUN([AC_C_LONG_LONG],
[AC_CACHE_CHECK(for long long int, ac_cv_c_long_long,
[if test "$GCC" = yes; then
ac_cv_c_long_long=yes
else
AC_TRY_COMPILE(,[long long int i;],
ac_cv_c_long_long=yes,
ac_cv_c_long_long=no)
fi])
if test $ac_cv_c_long_long = yes; then
AC_DEFINE(HAVE_LONG_LONG, 1, [compiler understands long long])
fi
])
AC_DEFUN([AC_C_PRINTF_THSEP],
[AC_TRY_COMPILE(,[printf("%'2d",101);],ac_cv_c_printf_thsep=yes,ac_cv_c_printf_thsep=no)
if test $ac_cv_c_printf_thsep = yes; then
AC_DEFINE(HAVE_PRINTF_THSEP, 1, [compiler understands printf flag for thousands separation in ints])
fi
])
AC_ARG_ENABLE(nocomparisoncount,
[--disable-comparisoncount Do not count comparisons.],
[case "${enableval}" in
yes) nocomparisoncount=true ;;
no) nocomparisoncount=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-comparisoncount) ;;
esac],[nocomparisoncount=true])
AM_CONDITIONAL(NOCOMPARISONCNT,test "$nocomparisoncount" = false)
AC_ARG_ENABLE(allocaok,
[--disable-allocaok Do not use alloca - use heap instead.],
[case "${enableval}" in
yes) allocaok=true ;;
no) allocaok=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-allocaok) ;;
esac],[allocaok=true])
AM_CONDITIONAL(ALLOCAOK,test "$allocaok" = true)
AC_ARG_ENABLE(uninum,
[--disable-uninum. Do not link uninum library.],
[case "${enableval}" in
yes) uninum=true ;;
no) uninum=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-uninum) ;;
esac],[uninum=true])
AM_CONDITIONAL(UNINUMOK,test "$uninum" = true)
AC_ARG_ENABLE(utf8proc,
[--disable-utf8proc. Use the icu library instead of utf8proc.],
[case "${enableval}" in
yes) utf8proc=true ;;
no) utf8proc=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-utf8proc) ;;
esac],[utf8proc=true])
AM_CONDITIONAL(UTF8PROCOK,test "$utf8proc" = true)
AC_ARG_ENABLE(debugbuild,
[--enable-debugbuild. Compile for debugging.],
[case "${enableval}" in
yes) debugbuild=true ;;
no) debugbuild=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debugbuild) ;;
esac],[debugbuild=false])
AM_CONDITIONAL(DEBUGBUILD,test "$debugbuild" = true)
# Checks for programs.
AC_PROG_CC
if ${debugbuild}; then
CFLAGS="-ggdb -g3"
else
CFLAGS="-g -O2"
fi
AC_PROG_INSTALL
# Checks for libraries.
AC_CHECK_LIB([tre], [tre_regwcomp],,[AC_MSG_ERROR([libtre not found. see http://laurikari.net/tre/])])
AC_CHECK_LIB([intl], [gettext],AC_DEFINE([HAVE_LIBINTL], [1],[Define to 1 if you have libintl.]),)
#AM_GNU_GETTEXT
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([alloca.h ctype.h errno.h gnu/libc-version.h langinfo.h libintl.h limits.h locale.h stdargs.h stddef.h stdint.h stdlib.h string.h sys/file.h sys/stat.h time.h tre/tre.h unicode/umachine.h unicode/unorm.h uninum/unicode.h uninum/nsdefs.h uninum/uninum.h unistd.h wchar.h wctype.h])
if ${utf8proc}; then
AC_CHECK_HEADER([utf8proc.h],[AC_DEFINE([HAVE_UTF8PROC_H], [1],[Define to 1 if you have <utf8proc.h>.])],[AC_MSG_ERROR([LIB UTF8PROC and its header is obligatory. See http://www.flexiguided.de/publications.utf8proc.en.html])])
fi
if ${uninum}; then
AC_CHECK_LIB([uninum],[uninum_version],,[AC_MSG_ERROR([libuninum not found])])
fi
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_C_LONG_LONG
AC_C_LONG_DOUBLE
AC_C_PRINTF_THSEP
# Checks for library functions.
AC_CHECK_FUNCS([getopt_long malloc mbstowcs nl_langinfo realloc regwcomp regwexec setlocale strchr strrchr strtod strtol uninum_gmp_version wcschr wcscmp wcscasecmp wcsxfrm])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
|