2 # Convenience wrapper for easily viewing/setting options that
3 # the project's CMake scripts will recognize
7 # check for `cmake` command
8 type cmake
> /dev
/null
2>&1 ||
{
10 This package requires CMake, please install it first, then you may
11 use this configure script to access CMake equivalent functionality.\
17 Usage: $0 [OPTION]... [VAR=VALUE]...
19 --builddir= The build directory
20 --generator= run cmake --help for a list of generators
21 --prefix= Snort++ installation prefix
24 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
25 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
26 --disable-static-ips-actions do not include ips actions in binary
27 --disable-static-inspectors do not include inspectors in binary
28 --disable-static-loggers do not include loggers in binary
29 --disable-static-ips-options do not include ips options in binary
30 --disable-static-search-engines do not include search engines in binary
31 --disable-static-codecs do not include codecs in binary
32 --enable-valgrind Only use if you are testing with valgrind.
33 --enable-ppm Enable packet/rule performance monitor
34 --enable-ppm-test Enable packet/rule performance monitor for readback
35 --enable-perf-profiling Enable preprocessor and rule performance profiling
36 --enable-linux-smp-stats Enable statistics reporting through proc
37 --enable-debug-msgs Enable debug printing options (bugreports and developers only)
38 --enable-debug Enable debugging options (bugreports and developers only)
39 --enable-gdb Enable gdb debugging information
40 --enable-profile Enable profiling options (developers only)
41 --disable-corefiles Prevent Snort from generating core files
42 --enable-intel-soft-cpm Enable Intel Soft CPM support
43 --enable-unit-tests Build unit tests
44 --enable-large-pcap Enable support for pcaps larger than 2 GB
45 --disable-static-daq Link static DAQ modules.
46 --enable-shell enable command line shell support
50 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
51 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
52 --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
54 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
55 --with-sysroot=DIR Search for dependent libraries within DIR
56 (or the compiler's sysroot if not specified).
57 --with-pcap-includes=DIR libpcap include directory
58 --with-pcap-libraries=DIR libpcap library directory
59 --with-luajit-includes=DIR luajit include directory
60 --with-luajit-libraries=DIR luajit library directory
61 --with-pcre-includes=DIR libpcre include directory
62 --with-pcre-libraries=DIR libpcre library directory
63 --with-openssl-includes=DIR openssl include directory
64 --with-openssl-library=LIB openssl library library - NOT THE DIRECTORY
65 --with-crypto-library=LIB openssl crypto library - NOT THE DIRECTORY
66 --with-dnet-includes=DIR libdnet include directory
67 --with-dnet-libraries=DIR libdnet library directory
68 --with-daq-includes=DIR DAQ include directory
69 --with-daq-libraries=DIR DAQ library directory
72 SIGNAL_SNORT_RELOAD=<value>
73 set the SIGNAL_SNORT_RELOAD value
74 SIGNAL_SNORT_DUMP_STATS<value>
75 set the SIGNAL_SNORT_DUMP_STATS value
76 SIGNAL_SNORT_ROTATE_STATS<value>
77 set the SIGNAL_SNORT_ROTATE_STATS value
78 SIGNAL_SNORT_READ_ATTR_TBL<value>
79 set the SIGNAL_SNORT_READ_ATTR_TBL value
82 sourcedir
="$( cd "$
( dirname "$0" )" && pwd )"
84 # Function to append a CMake cache entry definition to the
85 # CMakeCacheEntries variable
86 # $1 is the cache entry variable name
87 # $2 is the cache entry variable type
88 # $3 is the cache entry variable value
89 append_cache_entry
() {
90 CMakeCacheEntries
="$CMakeCacheEntries -D $1:$2=$3"
93 check_and_append_cache_entry
() {
95 append_cache_entry
$1 $2 $3
98 echo "the $1 variable, which is specified using a --with-* options,"
99 echo "requires an absolute path to the library. Could not stat the"
109 prefix
=/usr
/local
/snort
111 append_cache_entry CMAKE_INSTALL_PREFIX PATH
$prefix
115 while [ $# -ne 0 ]; do
117 -*=*) optarg
=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
130 CMakeGenerator
="$optarg"
134 append_cache_entry CMAKE_INSTALL_PREFIX PATH
$optarg
136 --disable-static-codecs)
137 append_cache_entry STATIC_CODECS BOOL false
139 --enable-static-codecs)
140 append_cache_entry STATIC_CODECS BOOL true
142 --disable-static-inspectors)
143 append_cache_entry STATIC_INSPECTORS BOOL false
145 --enable-static-inspectors)
146 append_cache_entry STATIC_INSPECTORS BOOL true
148 --disable-static-loggers)
149 append_cache_entry STATIC_LOGGERS BOOL false
151 --enable-static-loggers)
152 append_cache_entry STATIC_LOGGERS BOOL true
154 --disable-static-ips-options)
155 append_cache_entry STATIC_IPS_OPTIONS BOOL false
157 --enable-static-ips-actions)
158 append_cache_entry STATIC_IPS_ACTIONS BOOL true
160 --disable-static-ips-actions)
161 append_cache_entry STATIC_IPS_ACTIONS BOOL false
163 --enable-static-ips-options)
164 append_cache_entry STATIC_IPS_OPTIONS BOOL true
166 --disable-static-search-engines)
167 append_cache_entry STATIC_SEARCH_ENGINES BOOL false
169 --enable-static-search-engines)
170 append_cache_entry STATIC_SEARCH_ENGINES BOOL true
172 --disable-control-socket)
173 append_cache_entry BUILD_CONTROL_SOCKET BOOL false
175 --enable-control-socket)
176 append_cache_entry BUILD_CONTROL_SOCKET BOOL true
178 --disable-side-channel)
179 append_cache_entry BUILD_SIDE_CHANNEL BOOL false
181 --enable-side-channel)
182 append_cache_entry BUILD_SIDE_CHANNEL BOOL true
184 --disable-static-daq)
185 append_cache_entry ENABLE_STATIC_DAQ BOOL false
188 append_cache_entry ENABLE_STATIC_DAQ BOOL true
191 append_cache_entry ENABLE_VALGRIND BOOL false
194 append_cache_entry ENABLE_VALGRIND BOOL true
197 append_cache_entry ENABLE_PPM BOOL false
200 append_cache_entry ENABLE_PPM BOOL true
203 append_cache_entry ENABLE_PPM_TEST BOOL false
206 append_cache_entry ENABLE_PPM_TEST BOOL true
208 --disable-perf-profiling)
209 append_cache_entry ENABLE_PERFPROFILING BOOL false
211 --enable-perf-profiling)
212 append_cache_entry ENABLE_PERFPROFILING BOOL true
214 --disable-linux-smp-stats)
215 append_cache_entry ENABLE_LINUX_SMP_STATS BOOL false
217 --enable-linux-smp-stats)
218 append_cache_entry ENABLE_LINUX_SMP_STATS BOOL true
221 append_cache_entry ENABLE_PTHREAD BOOL false
224 append_cache_entry ENABLE_PTHREAD BOOL true
226 --disable-debug-msgs)
227 append_cache_entry ENABLE_DEBUG_MSGS BOOL false
230 append_cache_entry ENABLE_DEBUG_MSGS BOOL true
233 append_cache_entry ENABLE_GDB BOOL false
236 append_cache_entry ENABLE_GDB BOOL true
239 append_cache_entry ENABLE_PROFILE BOOL false
242 append_cache_entry ENABLE_PROFILE BOOL true
245 append_cache_entry ENABLE_DEBUG BOOL false
248 append_cache_entry ENABLE_DEBUG BOOL true
251 append_cache_entry BUILD_HA BOOL false
254 append_cache_entry BUILD_HA BOOL true
257 append_cache_entry ENABLE_COREFILES BOOL false
260 append_cache_entry ENABLE_COREFILES BOOL true
262 --disable-large-pcap)
263 append_cache_entry ENABLE_LARGE_PCAP BOOL false
266 append_cache_entry ENABLE_LARGE_PCAP BOOL true
268 --disable-intel-soft-cpm)
269 append_cache_entry ENABLE_INTEL_SOFT_CPM BOOL false
271 --enable-intel-soft-cpm)
272 append_cache_entry ENABLE_INTEL_SOFT_CPM BOOL true
275 append_cache_entry ENABLE_SHELL BOOL true
278 append_cache_entry ENABLE_SHELL BOOL false
280 --disable-side-channel)
281 append_cache_entry BUILD_SIDE_CHANNEL BOOL false
283 --enable-side-channel)
284 append_cache_entry BUILD_SIDE_CHANNEL BOOL true
286 --disable-unit-tests)
287 append_cache_entry BUILD_UNIT_TESTS BOOL false
290 append_cache_entry BUILD_UNIT_TESTS BOOL true
293 append_cache_entry MAKE_HTML_DOC BOOL false
296 append_cache_entry MAKE_HTML_DOC BOOL true
299 append_cache_entry MAKE_PDF_DOC BOOL false
302 append_cache_entry MAKE_PDF_DOC BOOL true
304 --with-openssl-includes=*)
305 append_cache_entry OPENSSL_INCLUDE_DIR PATH
$optarg
307 --with-openssl-library=*)
308 check_and_append_cache_entry OPENSSL_SSL_LIBRARY FILEPATH
$optarg
310 --with-crypto-library=*)
311 check_and_append_cache_entry OPENSSL_CRYPTO_LIBRARY FILEPATH
$optarg
313 --with-pcap-includes=*)
314 append_cache_entry PCAP_INCLUDE_DIR PATH
$optarg
316 --with-pcap-libraries=*)
317 append_cache_entry PCAP_LIBRARIES_DIR PATH
$optarg
319 --with-luajit-includes=*)
320 append_cache_entry LUAJIT_INCLUDE_DIR PATH
$optarg
322 --with-luajit-libraries=*)
323 append_cache_entry LUAJIT_LIBRARIES_DIR PATH
$optarg
325 --with-pcre-includes=*)
326 append_cache_entry PCRE_INCLUDE_DIR PATH
$optarg
328 --with-pcre-libraries=*)
329 append_cache_entry PCRE_LIBRARIES_DIR PATH
$optarg
331 --with-dnet-includes=*)
332 append_cache_entry DNET_INCLUDE_DIR PATH
$optarg
334 --with-dnet-libraries=*)
335 append_cache_entry DNET_LIBRARIES_DIR PATH
$optarg
337 --with-daq-includes=*)
338 append_cache_entry DAQ_INCLUDE_DIR PATH
$optarg
340 --with-daq-libraries=*)
341 append_cache_entry DAQ_LIBRARIES_DIR PATH
$optarg
343 # Currently unsupported
344 # --with-intel-soft-cpm-includes=*)
345 # append_cache_entry INTEL_SOFT_CPM_INCLUDE_DIR PATH $optarg
347 # --with-intel-soft-cpm-libraries=*)
348 # append_cache_entry INTEL_SOFT_CPM_LIBRARIES_DIR PATH $optarg
351 append_cache_entry FLEX_EXECUTABLE PATH
$optarg
354 append_cache_entry BISON_EXECUTABLE PATH
$optarg
356 SIGNAL_SNORT_RELOAD
=*)
357 append_cache_entry SIGNAL_SNORT_RELOAD STRING
$optarg
359 SIGNAL_SNORT_DUMP_STATS
=*)
360 append_cache_entry SIGNAL_SNORT_DUMP_STATS STRING
$optarg
362 SIGNAL_SNORT_ROTATE_STATS
=*)
363 append_cache_entry SIGNAL_SNORT_ROTATE_STATS STRING
$optarg
365 SIGNAL_SNORT_READ_ATTR_TBL
=*)
366 append_cache_entry SIGNAL_SNORT_READ_ATTR_TBL STRING
$optarg
369 echo "Invalid option '$1'. Try $0 --help to see available options."
376 if [ -d $builddir ]; then
377 # If build directory exists, check if it has a CMake cache
378 if [ -f $builddir/CMakeCache.txt
]; then
379 # If the CMake cache exists, delete it so that this configuration
380 # is not tainted by a previous one
381 rm -f $builddir/CMakeCache.txt
384 # Create build directory
388 echo "Build Directory : $builddir"
389 echo "Source Directory: $sourcedir"
392 if [ -n "$CMakeGenerator" ]; then
393 cmake
-G "$CMakeGenerator" $CMakeCacheEntries $sourcedir
395 cmake
$CMakeCacheEntries $sourcedir
398 echo "# This is the command used to configure this build" > config.status
399 echo $command >> config.status
400 chmod u
+x config.status