-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
configure.ac
84 lines (63 loc) · 2.3 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
AC_PREREQ([2.69])
AC_INIT([libgrabkernel], m4_esyscmd([git rev-list --count HEAD | tr -d '\n']), [[email protected]])
AC_CANONICAL_SYSTEM
AC_CANONICAL_HOST
AM_PROG_LIBTOOL
AM_INIT_AUTOMAKE([subdir-objects])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIRS([m4])
AC_DEFINE([VERSION_COMMIT_COUNT], "m4_esyscmd([git rev-list --count HEAD | tr -d '\n'])", [Git commit count])
AC_DEFINE([VERSION_COMMIT_SHA], "m4_esyscmd([git rev-parse HEAD | tr -d '\n'])", [Git commit sha])
AC_SUBST([VERSION_COMMIT_COUNT], ["m4_esyscmd([git rev-list --count HEAD | tr -d '\n'])"])
AC_SUBST([VERSION_COMMIT_SHA], ["m4_esyscmd([git rev-parse HEAD | tr -d '\n'])"])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
crypto_backend="none"
# Check for operating system
AC_MSG_CHECKING([whether we need platform-specific build settings])
case $host_os in
darwin* )
esac
CXXFLAGS+=" -std=c++11"
CFLAGS+=" -std=c11"
# Versioning.
# Checks for libraries.
LIBGENERAL_REQUIRES_STR="libgeneral >= 65"
PKG_CHECK_MODULES(libgeneral, $LIBGENERAL_REQUIRES_STR)
AC_SUBST([libgeneral_requires], [$LIBGENERAL_REQUIRES_STR])
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
[enable debug build(default is no)])],
[debug_build=true],
[debug_build=false])
AC_ARG_ENABLE([crashdump],
[AS_HELP_STRING([--enable-crashdump],
[enable crashdump feature(default is no)])],
[enable_crashdump=true],
[enable_crashdump=false])
if test "x$debug_build" == "xtrue"; then
echo "*** Note: debug build requested ***"
CFLAGS+=" -g -O0 -DDEBUG=1"
CXXFLAGS+=" -g -O0 -DDEBUG=1"
fi
if test "x$enable_crashdump" == "xtrue"; then
echo "*** Note: enable crashdump feature ***"
AC_DEFINE(DUMP_CRASH_BACKTRACE, 1, [Define if building with crash dump feature])
fi
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h unistd.h])
AC_CONFIG_FILES([Makefile
include/Makefile
libtakeover/Makefile
libtakeover.pc
tools/Makefile])
AC_OUTPUT
echo "
Configuration for $PACKAGE-$VERSION:
-------------------------------------------
install prefix ..........: $prefix"
echo " compiler ................: ${CC}
Now type 'make' to build $PACKAGE-$VERSION,
and then 'make install' for installation.
"