forked from OasisLMF/ktools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
179 lines (148 loc) · 4.88 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
AC_INIT([ktools], m4_esyscmd([tr -d '\n' < VERSION]), [support@oasislmf.org])
#AM_INIT_AUTOMAKE([gnu])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_CONFIG_MACRO_DIR([m4])
AC_LANG([C])
AC_LANG([C++])
AC_MSG_CHECKING([Check for /usr/bin/md5sum ])
if [[ -f /usr/bin/md5sum ]];
then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_NOTICE([ /usr/bin/md5sum not found - cannot do make check])
fi
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],
[enable debugging, default: no]),
[case "${enableval}" in
yes) debug=true ;;
no) debug=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
esac],
[debug=false])
dnl Enable static linking
AC_ARG_ENABLE([static],
AS_HELP_STRING([--enable-static], [Enable static link]))
AS_IF([test "x$enable_static" = "xyes"], [
LDFLAGS=-static
])
dnl Enable static linking
AC_ARG_ENABLE([osx],
AS_HELP_STRING([--enable-osx], [Enable OSX build]))
AS_IF([test "x$enable_osx" = "xyes"], [
CXXFLAGSX="-std=c++11 -D__unix -Wno-unused-result -g"
],
[
CXXFLAGSX="-std=c++11 -Wno-unused-result -fthreadsafe-statics -frtti -fno-omit-frame-pointer "
# LDFLAGS="-Wl,--gc-sections -Wl,--strip-all"
]
)
dnl Optimization level for O3
AC_ARG_ENABLE([o3],
AS_HELP_STRING([--enable-o3], [Enable O3 build]))
AS_IF([test "x$enable_o3" = "xyes"], [
CXXFLAGSY="-O3"
],
[
CXXFLAGSY="-O2"
]
)
:${CXXFLAGS="$CXXFLAGSX $CXXFLAGSY"}
AM_CONDITIONAL(DEBUG, test x"$debug" = x"true")
# For debug
# AC_SUBST([AM_CXXFLAGS], [-std=c++11 -Wno-unused-result -g -O3])
#AC_SUBST([AM_CXXFLAGS], [-std=c++11 -Wno-unused-result -ffunction-sections -fdata-sections -O3])
#AC_SUBST([AM_LDFLAGS], [-Wl,--gc-sections -Wl,--strip-all])
#if [[ -f ./fred ]];
#then
# :${CXXFLAGS="-std=c++11 -Wno-unused-result -ffunction-sections -fdata-sections -O3"}
# :${LDFLAGS="-Wl,--gc-sections -Wl,--strip-all"}
#else
# :${CXXFLAGS="-std=c++11 -D__unix -Wno-unused-result -g -O3"}
#fi
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CXX([c++ g++])
AC_PROG_CC([cc gcc])
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AX_CXX_COMPILE_STDCXX_11
AX_CHECK_ZLIB()
# Checks for libraries.
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h inttypes.h memory.h stdlib.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_INT64_T
AC_CONFIG_FILES([
Makefile
ktest/Makefile
src/Makefile
src/cdftocsv/Makefile
src/crossvalidation/Makefile
src/eve/Makefile
src/damagebintocsv/Makefile
src/damagebintobin/Makefile
src/fmcalc/Makefile
src/fmprofiletocsv/Makefile
src/fmprofiletobin/Makefile
src/fmpolicytctocsv/Makefile
src/fmpolicytctobin/Makefile
src/fmprogrammetobin/Makefile
src/fmprogrammetocsv/Makefile
src/fmtocsv/Makefile
src/randtocsv/Makefile
src/randtobin/Makefile
src/evetocsv/Makefile
src/evetobin/Makefile
src/gultobin/Makefile
src/getmodel/Makefile
src/gulcalc/Makefile
src/gultocsv/Makefile
src/itemtobin/Makefile
src/itemtocsv/Makefile
src/coveragetobin/Makefile
src/coveragetocsv/Makefile
src/summarycalc/Makefile
src/fmxreftocsv/Makefile
src/fmxreftobin/Makefile
src/summarycalctocsv/Makefile
src/eltcalc/Makefile
src/pltcalc/Makefile
src/gulsummaryxreftobin/Makefile
src/gulsummaryxreftocsv/Makefile
src/fmsummaryxreftobin/Makefile
src/fmsummaryxreftocsv/Makefile
src/occurrencetobin/Makefile
src/occurrencetocsv/Makefile
src/leccalc/Makefile
src/aalcalc/Makefile
src/aalcalctocsv/Makefile
src/vulnerabilitytobin/Makefile
src/vulnerabilitytocsv/Makefile
src/footprinttobin/Makefile
src/footprinttocsv/Makefile
src/periodstobin/Makefile
src/periodstocsv/Makefile
src/returnperiodtobin/Makefile
src/returnperiodtocsv/Makefile
src/kat/Makefile
src/footprintconv/Makefile
src/fmprofilebinconv/Makefile
src/validateitems/Makefile
src/validatedamagebin/Makefile
src/validatefootprint/Makefile
src/validateoasisfiles/Makefile
src/validatevulnerability/Makefile
src/summarycalctobin/Makefile
src/summaryindex/Makefile
src/kunit/Makefile
])
AC_OUTPUT
rm -f ktest/cwbld
rm -f ktest/uwbld