-
Notifications
You must be signed in to change notification settings - Fork 19
/
configure.ac
224 lines (192 loc) · 6.56 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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
AC_INIT([ktools], m4_esyscmd([tr -d '\n' < VERSION.txt]), [[email protected]])
#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.
# Check for pkg-config
AC_MSG_CHECKING([for pkg-config])
PKGCONFIG=no
pkg-config --version > /dev/null 2>&1 && PKGCONFIG=yes
AC_MSG_RESULT([$PKGCONFIG])
AS_IF([test "x$PKGCONFIG" = "xno"],
[AC_MSG_ERROR([cannot find pkg-config. Please install pkg-config and run ./configure again.])
])
# Check for arrow and parquet libraries
# Provide option to disable search for parquet libraries for debugging
AC_ARG_ENABLE([parquet],
[AS_HELP_STRING[--disable-parquet], [disable search for Parquet libraries]],
[enable_parquet=no], [enable_parquet=yes])
AH_TEMPLATE([HAVE_PARQUET])
AS_IF([test "x$enable_parquet" = "xyes"],
[AS_IF([test "x$enable_static" = "xyes"],
[PKG_CHECK_MODULES_STATIC([PARQUET], [arrow parquet],
[HAVE_PARQUET=yes], [HAVE_PARQUET=no])
LIBPTHREAD_LINK="-Wl,--whole-archive -lpthread -Wl,--no-whole-archive"
],
[PKG_CHECK_MODULES([PARQUET], [arrow parquet], [HAVE_PARQUET=yes],
[HAVE_PARQUET=no])
LIBPTHREAD_LINK=""
])
AC_SUBST(LIBPTHREAD_LINK)
])
AS_IF([test "$HAVE_PARQUET" = "yes"],
[AC_DEFINE([HAVE_PARQUET], [1],
[Define to 1 if you have Apache arrow (-larrow) and parquet (-lparquet) libraries])
])
AM_CONDITIONAL([HAVE_PARQUET], [test "$HAVE_PARQUET" = "yes"])
# 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/ensembletobin/Makefile
src/ensembletocsv/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/quantiletocsv/Makefile
src/quantiletobin/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/placalc/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/lossfactorstobin/Makefile
src/lossfactorstocsv/Makefile
src/ordleccalc/Makefile
src/aalcalc/Makefile
src/aalcalcmeanonly/Makefile
src/amplificationstobin/Makefile
src/amplificationstocsv/Makefile
src/vulnerabilitytobin/Makefile
src/vulnerabilitytocsv/Makefile
src/aggregatevulnerabilitytobin/Makefile
src/aggregatevulnerabilitytocsv/Makefile
src/weightstobin/Makefile
src/weightstocsv/Makefile
src/footprinttobin/Makefile
src/footprinttocsv/Makefile
src/periodstobin/Makefile
src/periodstocsv/Makefile
src/returnperiodtobin/Makefile
src/returnperiodtocsv/Makefile
src/kat/Makefile
src/katparquet/Makefile
src/footprintconv/Makefile
src/fmprofilebinconv/Makefile
src/validatedamagebin/Makefile
src/validatefootprint/Makefile
src/validateoasisfiles/Makefile
src/validatevulnerability/Makefile
src/summarycalctobin/Makefile
src/summaryindex/Makefile
])
AC_OUTPUT
rm -f ktest/cwbld
rm -f ktest/uwbld