1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- # -*- Autoconf -*-
- # Process this file with autoconf to produce a configure script.
-
- AC_PREREQ([2.69])
- AC_INIT([ttail], [0.0.1], [yann.weber@member.fsf.org])
- AM_INIT_AUTOMAKE
-
- #configure options
- AC_ARG_ENABLE([huge-file],[ --enable-huge-file to enable huge file support],
- [case "${enableval}" in
- yes) huge_file=true ;;
- no) huge_file=false ;;
- *) AC_MSG_ERROR([bad value ${enableval} for --enable-huge-file]) ;;
- esac],[huge_file=false])
- AM_CONDITIONAL([HUGEFILE], [test x$huge_file = xtrue])
- AC_ARG_ENABLE([debug],[ --enable-debug turn on debugging],
- [case "${enableval}" in
- yes) debug=true ;;
- no) debug=false ;;
- *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
- esac],[debug=false])
- AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
-
- AC_CONFIG_HEADERS([src/include/config.h])
- AC_CONFIG_SRCDIR([src/main.c])
- AC_CONFIG_MACRO_DIR([m4])
-
- # Checks for programs.
- AC_GNU_SOURCE
- AC_PROG_CC
- AM_PROG_CC_C_O
- AC_PROG_MAKE_SET
- AC_PROG_RANLIB
-
- # Checks for libraries.
- AC_SEARCH_LIBS([dlopen], [dl dld], [], [
- AC_MSG_ERROR([unable to find the dlopen() function])
- ])
- PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
- AS_IF([test x$debug = xtrue], [CK_FORK=no],[])
-
- # Checks for header files.
- AC_CHECK_HEADERS([stdlib.h string.h])
-
- # Checks for typedefs, structures, and compiler characteristics.
- AC_TYPE_SIZE_T
- AS_IF([test x$debug = xtrue], [
- AX_CHECK_CFLAGS([-Wall])
- AX_CHECK_CFLAGS([-g])
- AX_CHECK_CFLAGS([-ggdb])
- AX_CHECK_CFLAGS([-O0])
- ],
- [
- AX_CHECK_CFLAGS([-O2])
- AX_CHECK_CFLAGS([-std=c99 -pedantic])
- AX_CHECK_CFLAGS([-ansi])
- AX_CHECK_CFLAGS([-Wall -Werror])
- AX_CHECK_CFLAGS([-fgnu89-inline])
- ])
- AX_CHECK_CFLAGS([-D_XOPEN_SOURCE -D_GNU_SOURCE])
- #Condition done in Makefile.am
- #AS_IF([test x$huge_file = xtrue], [
- #AX_CHECK_CFLAGS([-DTTAIL_HUGE_FILE])
- #],[])
-
- # Checks for library functions.
- AC_FUNC_MALLOC
- AC_FUNC_REALLOC
-
- AC_CONFIG_FILES([Makefile
- src/Makefile
- tests/Makefile])
-
- AC_OUTPUT
|