-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
75 lines (65 loc) · 1.76 KB
/
configure.ac
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
AC_PREREQ([2.52])
AC_INIT(libtinySAK, 0.1, diopmamadou@doubango.org)
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([src/tsk.c])
dnl find suitable C++ compiler
AC_PROG_CC
AC_PROG_INSTALL
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
## Are we using Windows?
#dnl detecting WIN32
#case "$host" in
# *cygwin* | *mingw*)
# AC_DEFINE([WIN32], [], "Using Windows as target os.")
# ;;
# *)
# AC_MSG_RESULT(${host} is not Windows... I will do my best.)
# ;;
#esac
# CFLAGS
CFLAGS="${CFLAGS=}"
#echo Setting up build environment for ${target_cpu}${target_os}
### ENABLE-DEBUG
AC_MSG_CHECKING(whether to enable debugging)
debug_default="yes"
AC_ARG_ENABLE(debug,
[ --enable-debug[=no/yes] turn on/off debugging
[[default=$debug_default]]],
[ if test "x$enableval" = "xyes" ; then
CFLAGS="$CFLAGS -O0 -g3 -DDEBUG"
AC_MSG_RESULT(yes)
else
CFLAGS="$CFLAGS -O3 -NDEBUG"
AC_MSG_RESULT(no)
fi
],
[CFLAGS="$CFLAGS -O0 -g3 -DDEBUG"
AC_MSG_RESULT(yes)])
### DEBUG-LEVEL
AC_ARG_WITH(debug-level,
[ --with-debug-level[=level] Set debug-level to level [[default=info]]
info: informational
warn: warnings
error [default]: errors
fatal: fatal],
[ if test "x$withval" = "xinfo" ; then
AC_DEFINE(DEBUG_LEVEL, DEBUG_LEVEL_INFO, [info debug])
AC_MSG_RESULT(info)
elif test "x$withval" = "xwarn" ; then
AC_DEFINE(DEBUG_LEVEL, DEBUG_LEVEL_INFO, [warn debug])
AC_MSG_RESULT(warn)
elif test "x$withval" = "xerror" ; then
AC_DEFINE(DEBUG_LEVEL, DEBUG_LEVEL_ERROR, [error debug])
AC_MSG_RESULT(error)
elif test "x$withval" = "xfatal" ; then
AC_DEFINE(DEBUG_LEVEL, DEBUG_LEVEL_FATAL, [fatal debug])
AC_MSG_RESULT(fatal)
fi
])
AC_OUTPUT(
Makefile
src/Makefile
test/Makefile
)