|
@@ -4,13 +4,16 @@
|
4
|
4
|
AC_PREREQ([2.69])
|
5
|
5
|
AC_INIT([ttail], [0.0.1], [yann.weber@member.fsf.org])
|
6
|
6
|
|
7
|
|
-#AC_CONFIG_SRCDIR([src/ttail.c])
|
|
7
|
+AC_CONFIG_HEADERS([src/include/config.h])
|
|
8
|
+AC_CONFIG_SRCDIR([src/ttail.c])
|
8
|
9
|
AC_CONFIG_MACRO_DIR([m4])
|
9
|
10
|
|
10
|
11
|
# Checks for programs.
|
|
12
|
+AC_GNU_SOURCE
|
11
|
13
|
AC_PROG_CC
|
12
|
14
|
AM_PROG_CC_C_O
|
13
|
15
|
AC_PROG_MAKE_SET
|
|
16
|
+AC_PROG_RANLIB
|
14
|
17
|
|
15
|
18
|
# Checks for libraries.
|
16
|
19
|
AC_SEARCH_LIBS([dlopen], [dl dld], [], [
|
|
@@ -23,27 +26,38 @@ AC_CHECK_HEADERS([stdlib.h string.h])
|
23
|
26
|
|
24
|
27
|
# Checks for typedefs, structures, and compiler characteristics.
|
25
|
28
|
AC_TYPE_SIZE_T
|
26
|
|
-
|
|
29
|
+#CFLAGS="$CFLAGS -I$(top_builddir)/src/include/"
|
27
|
30
|
# Checks for library functions.
|
28
|
31
|
AC_FUNC_MALLOC
|
29
|
32
|
AC_FUNC_REALLOC
|
30
|
33
|
|
31
|
|
-AC_ARG_ENABLE([fmt_regex],
|
32
|
|
- AS_HELP_STRING([--disable-fmt-regex], [Disable regex format detection]))
|
33
|
|
-
|
34
|
|
-AS_IF([test "x$enable_fmt_regex" != "xno"], [
|
35
|
|
- AC_DEFINE([TTAIL_FMT_REGEX], [1],
|
36
|
|
- [define if using regex format])
|
37
|
|
- AC_SUBST([WANT_LIBFMT_REGEX],[1])
|
|
34
|
+AC_ARG_ENABLE([debug],[ --enable-debug turn on debugging],
|
|
35
|
+[case "${enableval}" in
|
|
36
|
+ yes) debug=true ;;
|
|
37
|
+ no) debug=false ;;
|
|
38
|
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
|
|
39
|
+esac],[debug=false])
|
|
40
|
+AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
|
|
41
|
+
|
|
42
|
+AS_IF([test x$debug = xtrue], [
|
|
43
|
+ AX_CHECK_CFLAGS([-Wall])
|
|
44
|
+ AX_CHECK_CFLAGS([-g])
|
|
45
|
+ AX_CHECK_CFLAGS([-ggdb])
|
|
46
|
+ AX_CHECK_CFLAGS([-O0])
|
|
47
|
+],
|
|
48
|
+[
|
|
49
|
+ AX_CHECK_CFLAGS([-O2])
|
|
50
|
+ AX_CHECK_CFLAGS([-std=c99 -pedantic])
|
|
51
|
+ AX_CHECK_CFLAGS([-ansi])
|
|
52
|
+ AX_CHECK_CFLAGS([-Wall -Werror])
|
|
53
|
+ AX_CHECK_CFLAGS([-fgnu89-inline])
|
38
|
54
|
])
|
|
55
|
+AX_CHECK_CFLAGS([-D_XOPEN_SOURCE -D_GNU_SOURCE])
|
39
|
56
|
|
40
|
57
|
AM_INIT_AUTOMAKE
|
41
|
58
|
|
42
|
|
-AM_CONDITIONAL([WANT_LIBFMT_REGEX], [test "x$enable_fmt_regex" != "xno"])
|
43
|
|
-
|
44
|
59
|
AC_CONFIG_FILES([Makefile
|
45
|
60
|
src/Makefile
|
46
|
61
|
tests/Makefile])
|
47
|
|
-AC_CONFIG_HEADERS([src/include/config.h])
|
48
|
62
|
|
49
|
63
|
AC_OUTPUT
|