-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in.ac
87 lines (67 loc) · 2.49 KB
/
configure.in.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
#------------------------------------------------------------------------------#
# Initialize autoconf
#------------------------------------------------------------------------------#
AC_INIT(hash_mark, VERSION_TAG, [email protected])
AC_CONFIG_AUX_DIR(config)
VERSION_INFORMATION="VERSION_TAG"
AC_SUBST(VERSION_INFORMATION)
AC_CONFIG_HEADERS([local/hm_config.h:local/hm_config.h.in])
#------------------------------------------------------------------------------#
# Initialize automake
#------------------------------------------------------------------------------#
AM_INIT_AUTOMAKE
#------------------------------------------------------------------------------#
# Configuration targets
#------------------------------------------------------------------------------#
AC_CONFIG_FILES([Makefile \
lib/Makefile \
bin/Makefile \
doc/Makefile \
doc/doxygen.conf \
])
#------------------------------------------------------------------------------#
# Program options
#------------------------------------------------------------------------------#
AC_PROG_CC
AC_PROG_CXX
AC_PROG_LIBTOOL
CONFIG_PROG_DOXYGEN
#------------------------------------------------------------------------------#
# Enable options
#------------------------------------------------------------------------------#
CONFIG_GENERIC_ENABLE(hm_assertions, HM_ASSERTIONS)
CONFIG_GENERIC_ENABLE(hm_debug, HM_DEBUG)
#------------------------------------------------------------------------------#
# Handle known C++ compilers
#------------------------------------------------------------------------------#
if [[[ "$CXXFLAGS" = *"-g -O2"* ]]] ; then
case "$cc_basename" in
g++|clang++)
STD_FLAG="-std=c++11"
CXXFLAGS="-O3"
;;
icc|icpc)
STD_FLAG="-std=c++0x"
CXXFLAGS="-O3"
;;
*)
AC_MSG_ERROR(unsupported C++ compiler)
;;
esac
EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS $STD_FLAG"
fi
#------------------------------------------------------------------------------#
# Set extras
#------------------------------------------------------------------------------#
AC_SUBST(EXTRA_CPPFLAGS)
#------------------------------------------------------------------------------#
# Handle Doxygen
#------------------------------------------------------------------------------#
if test "$HAS_DOXYGEN" = "yes" ; then
AC_SUBST(DOC, [doc])
AC_CONFIG_COMMANDS([doc], [make doc])
fi
#------------------------------------------------------------------------------#
# Output
#------------------------------------------------------------------------------#
AC_OUTPUT