forked from x0id/neutx
-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
88 lines (67 loc) · 2.17 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
76
77
78
79
80
81
82
83
84
85
86
87
88
dnl Process this file with autoconf to produce a configure script.
AC_INIT([neutx],[0.2])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([build-aux])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_HEADERS([config.h])
dnl save flags before boost tests
CXX_FLAGS_SAVED="${CXXFLAGS}"
dnl boost library
AX_BOOST_BASE
AX_BOOST_SYSTEM
dnl boost 1.47.0 (fedora 16), 1.48.0 (fedora 17) broken
dnl chrono library dependencies workaround
LD_FLAGS_SAVED=$LDFLAGS
LDFLAGS="${LDFLAGS% } $BOOST_LDFLAGS $BOOST_SYSTEM_LIB"
AX_BOOST_CHRONO
LDFLAGS=$LD_FLAGS_SAVED
AX_BOOST_UNIT_TEST_FRAMEWORK
dnl make use of boost lib dir
AC_SUBST([BOOSTLIBDIR])
dnl find list of all header files in include folder
inc_files_list=`find include -name \*.@<:@hi@:>@pp -print`
AC_SUBST([INCFILES], [`echo $inc_files_list`])
dnl Checks for programs.
AC_PROG_CXX
dnl Support static libraries via libtool
AM_PROG_AR
dnl Libtool
LT_INIT
dnl Checks for libraries.
dnl Tweaking build options.
dnl restore original flags, adding new options
CXXFLAGS="${CXX_FLAGS_SAVED% } -std=c++11 -MMD"
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],[enable debug [[default=yes]]]),
[ if test "x$enable_debug" = "xyes" -o -z "x$enable_debug"; then
CXXFLAGS="${CXXFLAGS% } -g -O0 -Wall"
fi
]
)
AC_ARG_ENABLE(optimize,
AS_HELP_STRING([--enable-optimize],[enable optimization [[default=no]]]),
[ if test "x$enable_optimize" = "xyes" ; then
CXXFLAGS="${CXXFLAGS% } -g -O3 -fno-strict-aliasing"
fi
]
)
AC_ARG_ENABLE(warnings,
AS_HELP_STRING([--enable-warnings],[enable all warnings [[default=yes]]]),
[ if test "x$enable_warnings" = "xyes" -o -z "$enable_warnings"; then
CXXFLAGS="${CXXFLAGS% } -Wall -Werror"
fi
]
)
dnl optional build demo
AC_ARG_ENABLE(demo,
AS_HELP_STRING([--enable-demo],[compile demo programs [[default=no]]]),
[case ${enableval} in yes) demo=true;; *) demo=false;; esac], [demo=false]
)
AM_CONDITIONAL([DEMO], [test "x$demo" = "xtrue"])
dnl Output.
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([src/Makefile])
AC_CONFIG_FILES([test/Makefile])
AC_CONFIG_FILES([demo/Makefile])
AC_CONFIG_FILES([test.sh], [chmod +x test.sh])
AC_OUTPUT