1# Process this file with autoconf to produce a configure script.
2
3AC_INIT([blame], [1.3.1], [foonly@users.sourceforge.net])
4AC_CONFIG_SRCDIR([src/blame.c])
5AC_CONFIG_HEADER([config.h])
6AM_INIT_AUTOMAKE([-Wall ansi2knr std-options])
7AC_SUBST(RELEASE, 1)
8
9AC_CONFIG_MACRO_DIR(m4)
10AC_CONFIG_LIBOBJ_DIR(lib)
11AC_CONFIG_TESTDIR(tests, tests:src)
12
13AC_GNU_SOURCE
14
15# Checks for programs.
16AC_PROG_CC
17AM_PROG_CC_C_O
18gl_EARLY
19AM_PROG_LEX
20AC_PROG_YACC
21AC_PROG_RANLIB
22
23# Checks for libraries.
24
25# Checks for header files.
26AC_HEADER_STDC
27AC_CHECK_HEADERS_ONCE([libintl.h])
28
29# Checks for typedefs, structures, and compiler characteristics.
30AC_C_CONST
31AC_C_INLINE
32AM_C_PROTOTYPES
33AC_C_STRINGIZE
34AC_C_VOLATILE
35AC_TYPE_SIZE_T
36AC_TYPE_OFF_T
37
38# canonicalize gnulib module needs this
39gl_AC_TYPE_UINTMAX_T
40
41AH_BOTTOM([
42#ifndef PARAMS
43# if PROTOTYPES
44#  define PARAMS(protos) protos
45# else /* ! PROTOTYPES */
46#  define PARAMS(protos) ()
47# endif /* ! PROTOTYPES */
48#endif
49])
50
51AH_BOTTOM([
52/* Avoid memory leak in argp */
53#define GNULIB_ARGP_DISABLE_DIRNAME 1
54])
55
56# Checks for library functions.
57gl_INIT
58mac_HAVE_NL_LANGINFO
59
60AC_FUNC_MMAP
61AC_SYS_LONG_FILE_NAMES
62
63dnl This relies on certain dos.m4 behaviour...
64AC_SUBST(FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR,
65	[$ac_fs_backslash_is_file_name_separator])
66
67AH_BOTTOM([
68#if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
69# define SUFFIXES "\\,v"
70# define DIRECTORY_SEPARATOR '\\'
71# define SSLASH "\\"
72#else /* ! FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR */
73# define SUFFIXES ",v/"
74# define DIRECTORY_SEPARATOR '/'
75# define SSLASH "/"
76#endif /* ! FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR */
77])
78
79AC_ARG_ENABLE(debug,
80	AS_HELP_STRING(--enable-debug, [include debug code (e.g. assertions)]))
81case "$enable_debug" in
82no|"")
83	AC_DEFINE(NDEBUG, 1, [Define to 1 to disable assertions])
84	;;
85*)
86	;;
87esac
88
89AC_ARG_ENABLE(debug,
90	AS_HELP_STRING(--enable-profile, [enable profiling]))
91case "$enable_profile" in
92no|"")
93	;;
94*)
95	if test "$GCC" != "yes"; then
96		AC_MSG_ERROR([I can only use profiling on GCC])
97	fi
98	CFLAGS=`echo $CFLAGS -pg -fprofile-arcs -ftest-coverage | sed -e s,-O2,-O0,`
99	LDFLAGS="$LDFLAGS -pg -fprofile-arcs -ftest-coverage"
100	;;
101esac
102
103AC_ARG_ENABLE(fastexit,
104	AS_HELP_STRING(--disable-fastexit, [free all memory when exiting]))
105case "$enable_fastexit" in
106yes|"")
107	AC_DEFINE(FASTEXIT, 1, [Define to 1 to exit quickly without freeing all memory])
108	FASTEXIT=1
109	;;
110*)
111	FASTEXIT=0
112	;;
113esac
114AC_SUBST([FASTEXIT])
115
116AM_CONDITIONAL(GCC, test "$GCC" = yes)
117CFLAGS=`echo $CFLAGS | sed -e s,-O2,-O3,`
118
119NEWS=NEWS
120AC_SUBST_FILE(NEWS)
121
122AC_CONFIG_FILES([
123	Makefile
124	doc/Makefile
125	lib/Makefile
126	src/Makefile
127	tests/Makefile
128	tests/atlocal
129	blame.spec
130])
131AC_OUTPUT
132