-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathconfigure.ac
70 lines (61 loc) · 1.61 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
AC_INIT([libckit], [0.1], [[email protected]])
AC_CONFIG_MACRO_DIR([m4])
# Use the silent-rules feature when possible.
m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
AM_SILENT_RULES([yes])
# support for cross compiling
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CPP
AM_PROG_AR
AC_PROG_LIBTOOL
AC_PROG_INSTALL
AC_CONFIG_HEADERS([config.h])
CPPFLAGS=
CFLAGS=-Wall
CXXFLAGS=-Wall
EXTRA_DEFINES=
case $host in
*-*-linux*)
os_type=linux
CPPFLAGS="${CPPFLAGS} -DOS_LINUX"
;;
*-*-darwin*)
os_type=bsd
os_variant=darwin
CPPFLAGS="${CPPFLAGS} -DOS_DARWIN -DOS_BSD"
;;
esac
# Set some automake variables
AM_CONDITIONAL(OS_LINUX, [test x$os_type = xlinux])
AM_CONDITIONAL(OS_BSD, [test x$os_type = xbsd])
AM_CONDITIONAL(OS_DARWIN, [test x$os_variant = xdarwin])
dnl Option to set debugging
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug],[Turn on debugging]),
[case "${enableval}" in
yes) debug=yes ;;
no) debug=no ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
esac],[debug=no])
AM_CONDITIONAL([DEBUG], [test x$debug = xyes])
if test x$debug = xyes
then
EXTRA_DEFINES="${EXTRA_DEFINES} -DENABLE_DEBUG"
CFLAGS="$CFLAGS -g -O0 -fno-inline"
CXXFLAGS="$CXXFLAGS -g -O0 -fno-inline"
else
CFLAGS="$CFLAGS -O2"
CXXFLAGS="$CXXFLAGS -O2"
fi
CPPFLAGS="${CPPFLAGS} ${EXTRA_DEFINES}"
#CFLAGS="${CFLAGS} ${EXTRA_DEFINES}"
#CXXFLAGS="${CXXFLAGS} ${EXTRA_DEFINES}"
AC_SUBST(EXTRA_DEFINES)
AC_CONFIG_FILES([
Makefile
src/Makefile
])
AC_OUTPUT