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-perfprofiling 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.
48 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
49 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
50 --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
52 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
53 --with-sysroot=DIR Search for dependent libraries within DIR
54 (or the compiler's sysroot if not specified).
55 --with-pcap-includes=DIR libpcap include directory
56 --with-pcap-libraries=DIR libpcap library directory
57 --with-luajit-includes=DIR luajit include directory
58 --with-luajit-libraries=DIR luajit library directory
59 --with-pcre-includes=DIR libpcre include directory
60 --with-pcre-libraries=DIR libpcre library directory
61 --with-openssl-includes=DIR openssl include directory
62 --with-openssl-library=LIB openssl library library - NOT THE DIRECTORY
63 --with-crypto-library=LIB openssl crypto library - NOT THE DIRECTORY
64 --with-dnet-includes=DIR libdnet include directory
65 --with-dnet-libraries=DIR libdnet library directory
66 --with-daq-includes=DIR DAQ include directory
67 --with-daq-libraries=DIR DAQ library directory
70 SIGNAL_SNORT_RELOAD=<value>
71 set the SIGNAL_SNORT_RELOAD value
72 SIGNAL_SNORT_DUMP_STATS<value>
73 set the SIGNAL_SNORT_DUMP_STATS value
74 SIGNAL_SNORT_ROTATE_STATS<value>
75 set the SIGNAL_SNORT_ROTATE_STATS value
76 SIGNAL_SNORT_READ_ATTR_TBL<value>
77 set the SIGNAL_SNORT_READ_ATTR_TBL value
80 sourcedir
="$( cd "$
( dirname "$0" )" && pwd )"
82 # Function to append a CMake cache entry definition to the
83 # CMakeCacheEntries variable
84 # $1 is the cache entry variable name
85 # $2 is the cache entry variable type
86 # $3 is the cache entry variable value
87 append_cache_entry
() {
88 CMakeCacheEntries
="$CMakeCacheEntries -D $1:$2=$3"
91 check_and_append_cache_entry
() {
93 append_cache_entry
$1 $2 $3
96 echo "the $1 variable, which is specified using a --with-* options,"
97 echo "requires an absolute path to the library. Could not stat the"
107 prefix
=/usr
/local
/snort
109 append_cache_entry CMAKE_INSTALL_PREFIX PATH
$prefix
113 while [ $# -ne 0 ]; do
115 -*=*) optarg
=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
128 CMakeGenerator
="$optarg"
132 append_cache_entry CMAKE_INSTALL_PREFIX PATH
$optarg
134 --disable-static-codecs)
135 append_cache_entry STATIC_CODECS BOOL false
137 --enable-static-codecs)
138 append_cache_entry STATIC_CODECS BOOL true
140 --disable-static-inspectors)
141 append_cache_entry STATIC_INSPECTORS BOOL false
143 --enable-static-inspectors)
144 append_cache_entry STATIC_INSPECTORS BOOL true
146 --disable-static-loggers)
147 append_cache_entry STATIC_LOGGERS BOOL false
149 --enable-static-loggers)
150 append_cache_entry STATIC_LOGGERS BOOL true
152 --disable-static-ips-options)
153 append_cache_entry STATIC_IPS_OPTIONS BOOL false
155 --enable-static-ips-actions)
156 append_cache_entry STATIC_IPS_ACTIONS BOOL true
158 --disable-static-ips-actions)
159 append_cache_entry STATIC_IPS_ACTIONS BOOL false
161 --enable-static-ips-options)
162 append_cache_entry STATIC_IPS_OPTIONS BOOL true
164 --disable-static-search-engines)
165 append_cache_entry STATIC_SEARCH_ENGINES BOOL false
167 --enable-static-search-engines)
168 append_cache_entry STATIC_SEARCH_ENGINES BOOL true
170 --disable-control-socket)
171 append_cache_entry BUILD_CONTROL_SOCKET BOOL false
173 --enable-control-socket)
174 append_cache_entry BUILD_CONTROL_SOCKET BOOL true
176 --disable-side-channel)
177 append_cache_entry BUILD_SIDE_CHANNEL BOOL false
179 --enable-side-channel)
180 append_cache_entry BUILD_SIDE_CHANNEL BOOL true
182 --disable-static-daq)
183 append_cache_entry ENABLE_STATIC_DAQ BOOL false
186 append_cache_entry ENABLE_STATIC_DAQ BOOL true
189 append_cache_entry ENABLE_VALGRIND BOOL false
192 append_cache_entry ENABLE_VALGRIND BOOL true
195 append_cache_entry ENABLE_PPM BOOL false
198 append_cache_entry ENABLE_PPM BOOL true
201 append_cache_entry ENABLE_PPM_TEST BOOL false
204 append_cache_entry ENABLE_PPM_TEST BOOL true
206 --disable-perfprofiling)
207 append_cache_entry ENABLE_PERFPROFILING BOOL false
209 --enable-perfprofiling)
210 append_cache_entry ENABLE_PERFPROFILING BOOL true
212 --disable-linux-smp-stats)
213 append_cache_entry ENABLE_LINUX_SMP_STATS BOOL false
215 --enable-linux-smp-stats)
216 append_cache_entry ENABLE_LINUX_SMP_STATS BOOL true
219 append_cache_entry ENABLE_PTHREAD BOOL false
222 append_cache_entry ENABLE_PTHREAD BOOL true
224 --disable-debug-msgs)
225 append_cache_entry ENABLE_DEBUG_MSGS BOOL false
228 append_cache_entry ENABLE_DEBUG_MSGS BOOL true
231 append_cache_entry ENABLE_GDB BOOL false
234 append_cache_entry ENABLE_GDB BOOL true
237 append_cache_entry ENABLE_PROFILE BOOL false
240 append_cache_entry ENABLE_PROFILE BOOL true
243 append_cache_entry ENABLE_DEBUG BOOL false
246 append_cache_entry ENABLE_DEBUG BOOL true
249 append_cache_entry BUILD_HA BOOL false
252 append_cache_entry BUILD_HA BOOL true
255 append_cache_entry ENABLE_COREFILES BOOL false
258 append_cache_entry ENABLE_COREFILES BOOL true
260 --disable-large-pcap)
261 append_cache_entry ENABLE_LARGE_PCAP BOOL false
264 append_cache_entry ENABLE_LARGE_PCAP BOOL true
266 --disable-intel-soft-cpm)
267 append_cache_entry ENABLE_INTEL_SOFT_CPM BOOL false
269 --enable-intel-soft-cpm)
270 append_cache_entry ENABLE_INTEL_SOFT_CPM BOOL true
272 --disable-side-channel)
273 append_cache_entry BUILD_SIDE_CHANNEL BOOL false
275 --enable-side-channel)
276 append_cache_entry BUILD_SIDE_CHANNEL BOOL true
278 --disable-unit-tests)
279 append_cache_entry BUILD_UNIT_TESTS BOOL false
282 append_cache_entry BUILD_UNIT_TESTS BOOL true
285 append_cache_entry MAKE_HTML_DOC BOOL false
288 append_cache_entry MAKE_HTML_DOC BOOL true
291 append_cache_entry MAKE_PDF_DOC BOOL false
294 append_cache_entry MAKE_PDF_DOC BOOL true
296 --with-openssl-includes=*)
297 append_cache_entry OPENSSL_INCLUDE_DIR PATH
$optarg
299 --with-openssl-library=*)
300 check_and_append_cache_entry OPENSSL_SSL_LIBRARY FILEPATH
$optarg
302 --with-crypto-library=*)
303 check_and_append_cache_entry OPENSSL_CRYPTO_LIBRARY FILEPATH
$optarg
305 --with-pcap-includes=*)
306 append_cache_entry PCAP_INCLUDE_DIR PATH
$optarg
308 --with-pcap-libraries=*)
309 append_cache_entry PCAP_LIBRARIES_DIR PATH
$optarg
311 --with-luajit-includes=*)
312 append_cache_entry LUAJIT_INCLUDE_DIR PATH
$optarg
314 --with-luajit-libraries=*)
315 append_cache_entry LUAJIT_LIBRARIES_DIR PATH
$optarg
317 --with-pcre-includes=*)
318 append_cache_entry PCRE_INCLUDE_DIR PATH
$optarg
320 --with-pcre-libraries=*)
321 append_cache_entry PCRE_LIBRARIES_DIR PATH
$optarg
323 --with-dnet-includes=*)
324 append_cache_entry DNET_INCLUDE_DIR PATH
$optarg
326 --with-dnet-libraries=*)
327 append_cache_entry DNET_LIBRARIES_DIR PATH
$optarg
329 --with-daq-includes=*)
330 append_cache_entry DAQ_INCLUDE_DIR PATH
$optarg
332 --with-daq-libraries=*)
333 append_cache_entry DAQ_LIBRARIES_DIR PATH
$optarg
335 # Currently unsupported
336 # --with-intel-soft-cpm-includes=*)
337 # append_cache_entry INTEL_SOFT_CPM_INCLUDE_DIR PATH $optarg
339 # --with-intel-soft-cpm-libraries=*)
340 # append_cache_entry INTEL_SOFT_CPM_LIBRARIES_DIR PATH $optarg
343 append_cache_entry FLEX_EXECUTABLE PATH
$optarg
346 append_cache_entry BISON_EXECUTABLE PATH
$optarg
348 SIGNAL_SNORT_RELOAD
=*)
349 append_cache_entry SIGNAL_SNORT_RELOAD STRING
$optarg
351 SIGNAL_SNORT_DUMP_STATS
=*)
352 append_cache_entry SIGNAL_SNORT_DUMP_STATS STRING
$optarg
354 SIGNAL_SNORT_ROTATE_STATS
=*)
355 append_cache_entry SIGNAL_SNORT_ROTATE_STATS STRING
$optarg
357 SIGNAL_SNORT_READ_ATTR_TBL
=*)
358 append_cache_entry SIGNAL_SNORT_READ_ATTR_TBL STRING
$optarg
361 echo "Invalid option '$1'. Try $0 --help to see available options."
368 if [ -d $builddir ]; then
369 # If build directory exists, check if it has a CMake cache
370 if [ -f $builddir/CMakeCache.txt
]; then
371 # If the CMake cache exists, delete it so that this configuration
372 # is not tainted by a previous one
373 rm -f $builddir/CMakeCache.txt
376 # Create build directory
380 echo "Build Directory : $builddir"
381 echo "Source Directory: $sourcedir"
384 if [ -n "$CMakeGenerator" ]; then
385 cmake
-G "$CMakeGenerator" $CMakeCacheEntries $sourcedir
387 cmake
$CMakeCacheEntries $sourcedir
390 echo "# This is the command used to configure this build" > config.status
391 echo $command >> config.status
392 chmod u
+x config.status