Newer
Older
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
# Require a recent version of autotools
AC_PREREQ(2.59)
# Auto conf init
AC_INIT([sudoku],[1.0],[seblu@seblu.net], [sudoku])
# Define configure generator directory
AC_CONFIG_AUX_DIR([build])
# Auto Make init
AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
# Check platform
AC_CANONICAL_HOST
CXXFLAGS='-Wall -W -ansi -pedantic -D_XOPEN_SOURCE=600'
# Check for C++ compiler
AC_LANG([C++])
AC_PROG_CXX
# Check for Make
AC_PROG_MAKE_SET
# check for ranlib
AC_PROG_RANLIB
# Check for lib efence
AC_CHECK_LIB([efence], [malloc], [EFENCELIB=-lefence])
AC_SUBST([EFENCELIB])
# Checks for library functions.
# Checks for typedefs, structures, and compiler characteristics.
# Check for headers
dnl Memo:
dnl AC ARG WITH(package, help-string, [action-if-given], [action-if-not-given])
AC_ARG_WITH([noerror],
[AS_HELP_STRING([--with-noerror], [Warning dont create compilation error])],
[dnl action-if-given
true
],
[dnl action-if-not-given
CXXFLAGS="$CFLAGS -Werror"
]
)
AC_ARG_WITH([debug],
[AS_HELP_STRING([--with-debug], [use -g and don't use -DNDEBUG -O3])],
[dnl action-if-given
CXXFLAGS="$CFLAGS -g"
],
[dnl action-if-not-given
CXXFLAGS="$CFLAGS -DNDEBUG -O3"
]
)
AC_ARG_WITH([efence],
[AS_HELP_STRING([--with-efence], [link with lib efence])],
[dnl action-if-given
LDFLAGS="$LDFLAGS -lefence"
CXXFLAGS="$CXXFLAGS -include stdlib.h -include efence.h"
],
[dnl action-if-not-given
test "$dynamic" = "true" || LDFLAGS="$LDFLAGS -static"
]
)
AC_SUBST([CXXFLAGS])
AC_SUBST([LDFLAGS])
# define Autoconf config header
AC_CONFIG_HEADERS([config.h])
# define Autoconf config files
AC_CONFIG_FILES([
Makefile
])
AC_OUTPUT