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]...
20 --builddir=DIR place build files in directory [build]
21 --generator=GENERATOR CMake generator to use (see cmake --help)
23 Installation Directories:
24 --prefix=PREFIX installation directory [/usr/local/bro]
25 --conf-files-dir=PATH config files installation directory [PREFIX/etc]
28 --disable-option-checking ignore unrecognized --enable/--with options
29 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
30 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
31 --enable-silent-rules less verbose build output (undo: \"make V=1\")
32 --disable-silent-rules verbose build output (undo: \"make V=0\")
33 --enable-shared[=PKGS] build shared libraries [default=yes]
34 --enable-static[=PKGS] build static libraries [default=yes]
35 --enable-fast-install[=PKGS]
36 optimize for fast installation [default=yes]
37 --enable-dependency-tracking
38 do not reject slow dependency extractors
39 --disable-dependency-tracking
40 speeds up one-time build
41 --disable-libtool-lock avoid locking (might break parallel builds)
42 --disable-static-inspectors do not include inspectors in binary
43 --disable-static-loggers do not include loggers in binary
44 --disable-static-ips-options do not include ips options in binary
45 --disable-static-search-engines do not include search engines in binary
46 --disable-static-codecs do not include codecs in binary
47 --enable-control-socket Enable the control socket (Linux only)
48 --enable-side-channel Enable the side channel (Linux only)
49 --enable-valgrind Only use if you are testing with valgrind.
50 --disable-ppm Disable packet/rule performance monitor
51 --enable-ppm-test Enable packet/rule performance monitor for readback
52 --disable-perfprofiling Disable preprocessor and rule performance profiling
53 --enable-linux-smp-stats Enable statistics reporting through proc
54 --enable-inline-init-failopen Enable Fail Open during initialization for Inline Mode (adds pthread support implicitly)
55 --disable-pthread Disable pthread support
56 --enable-debug-msgs Enable debug printing options (bugreports and developers only)
57 --enable-debug Enable debugging options (bugreports and developers only)
58 --enable-gdb Enable gdb debugging information
59 --enable-profile Enable profiling options (developers only)
60 --enable-sourcefire Enable Sourcefire specific build options, encompasing --enable-perfprofiling and --enable-ppm
61 --disable-corefiles Prevent Snort from generating core files
62 --enable-ha Enable high-availability state sharing
63 --enable-non-ether-decoders Enable non Ethernet decoders.
64 --enable-intel-soft-cpm Enable Intel Soft CPM support
65 --enable-unit-tests Build unit tests
66 --enable-large-pcap Enable support for pcaps larger than 2 GB
67 --disable-static-daq Link static DAQ modules.
70 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
71 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
72 --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
74 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
75 --with-sysroot=DIR Search for dependent libraries within DIR
76 (or the compiler's sysroot if not specified).
77 --with-pcap-includes=DIR libpcap include directory
78 --with-pcap-libraries=DIR libpcap library directory
79 --with-luajit-includes=DIR luajit include directory
80 --with-luajit-libraries=DIR luajit library directory
81 --with-pcre-includes=DIR libpcre include directory
82 --with-pcre-libraries=DIR libpcre library directory
83 --with-openssl-includes=DIR openssl include directory
84 --with-openssl-libraries=DIR openssl library directory
85 --with-dnet-includes=DIR libdnet include directory
86 --with-dnet-libraries=DIR libdnet library directory
87 --with-daq-includes=DIR DAQ include directory
88 --with-daq-libraries=DIR DAQ library directory
89 --with-intel-soft-cpm-includes=DIR Intel Soft CPM include directory
90 --with-intel-soft-cpm-libraries=DIR Intel Soft CPM library directory
92 Some influential environment variables:
94 CFLAGS C compiler flags
95 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
96 nonstandard directory <lib dir>
97 LIBS libraries to pass to the linker, e.g. -l<library>
98 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
99 you have headers in a nonstandard directory <include dir>
101 CXX C++ compiler command
102 CXXFLAGS C++ compiler flags
103 CXXCPP C++ preprocessor
105 set the SIGNAL_SNORT_RELOAD value
106 SIGNAL_SNORT_DUMP_STATS
107 set the SIGNAL_SNORT_DUMP_STATS value
108 SIGNAL_SNORT_ROTATE_STATS
109 set the SIGNAL_SNORT_ROTATE_STATS value
110 SIGNAL_SNORT_READ_ATTR_TBL
111 set the SIGNAL_SNORT_READ_ATTR_TBL value
113 Use these variables to override the choices made by \`configure' or to help
114 it to find libraries and programs with nonstandard names/locations.
116 Report bugs to the package provider.
119 sourcedir
="$( cd "$
( dirname "$0" )" && pwd )"
121 # Function to append a CMake cache entry definition to the
122 # CMakeCacheEntries variable
123 # $1 is the cache entry variable name
124 # $2 is the cache entry variable type
125 # $3 is the cache entry variable value
126 append_cache_entry
() {
127 CMakeCacheEntries
="$CMakeCacheEntries -D $1:$2=$3"
130 check_and_append_cache_entry
() {
132 append_cache_entry
$1 $2 $3
135 echo "the $1 variable, which is specified using a --with-* options,"
136 echo "requires an absolute path to the library. Could not stat the"
146 prefix
=/usr
/local
/snort
148 append_cache_entry CMAKE_INSTALL_PREFIX PATH
$prefix
152 while [ $# -ne 0 ]; do
154 -*=*) optarg
=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
167 CMakeGenerator
="$optarg"
171 append_cache_entry CMAKE_INSTALL_PREFIX PATH
$optarg
173 --disable-static-codecs)
174 append_cache_entry STATIC_CODECS BOOL false
176 --enable-static-codecs)
177 append_cache_entry STATIC_CODECS BOOL true
179 --disable-static-inspectors)
180 append_cache_entry STATIC_INSPECTORS BOOL false
182 --enable-static-inspectors)
183 append_cache_entry STATIC_INSPECTORS BOOL true
185 --disable-static-loggers)
186 append_cache_entry STATIC_LOGGERS BOOL false
188 --enable-static-loggers)
189 append_cache_entry STATIC_LOGGERS BOOL true
191 --disable-static-ips-option)
192 append_cache_entry STATIC_IPS_OPTIONS BOOL false
194 --enable-static-ips-option)
195 append_cache_entry STATIC_IPS_OPTIONS BOOL true
197 --disable-static-search-engines)
198 append_cache_entry STATIC_SEARCH_ENGINES BOOL false
200 --enable-static-search-engines)
201 append_cache_entry STATIC_SEARCH_ENGINES BOOL true
203 --disable-control-socket)
204 append_cache_entry BUILD_CONTROL_SOCKET BOOL false
206 --enable-control-socket)
207 append_cache_entry BUILD_CONTROL_SOCKET BOOL true
209 --disable-side-channel)
210 append_cache_entry BUILD_SIDE_CHANNEL BOOL false
212 --enable-side-channel)
213 append_cache_entry BUILD_SIDE_CHANNEL BOOL true
215 --disable-static-daq)
216 append_cache_entry ENABLE_STATIC_DAQ BOOL false
219 append_cache_entry ENABLE_STATIC_DAQ BOOL true
222 append_cache_entry ENABLE_VALGRIND BOOL false
225 append_cache_entry ENABLE_VALGRIND BOOL true
228 append_cache_entry ENABLE_PPM BOOL false
231 append_cache_entry ENABLE_PPM BOOL true
234 append_cache_entry ENABLE_PPM BOOL false
237 append_cache_entry ENABLE_PPM BOOL true
239 --disable-perfprofiling)
240 append_cache_entry ENABLE_PERFPROFILING BOOL false
242 --enable-perfprofiling)
243 append_cache_entry ENABLE_PERFPROFILING BOOL true
245 --disable-linux-smp-stats)
246 append_cache_entry ENABLE_INLINE_INIT_FAILOPEN BOOL false
248 --enable-linux-smp-stats)
249 append_cache_entry ENABLE_INLINE_INIT_FAILOPEN BOOL true
252 append_cache_entry ENABLE_PTHREAD BOOL false
255 append_cache_entry ENABLE_PTHREAD BOOL true
257 --disable-debug_msgs)
258 append_cache_entry ENABLE_DEBUG_MSGS BOOL false
261 append_cache_entry ENABLE_DEBUG_MSGS BOOL true
264 append_cache_entry ENABLE_GDB BOOL false
267 append_cache_entry ENABLE_GDB BOOL true
270 append_cache_entry ENABLE_PROFILE BOOL false
273 append_cache_entry ENABLE_PROFILE BOOL true
275 --disable-sourcefire)
276 append_cache_entry ENABLE_SOURCEFIRE BOOL false
279 append_cache_entry ENABLE_SOURCEFIRE BOOL true
282 append_cache_entry ENABLE_COREFILES BOOL false
285 append_cache_entry ENABLE_COREFILES BOOL true
288 append_cache_entry BUILD_HA BOOL false
291 append_cache_entry BUILD_HA BOOL true
293 --disable-large-pcap)
294 append_cache_entry ENABLE_LARGE_PCAP BOOL false
297 append_cache_entry ENABLE_LARGE_PCAP BOOL true
299 --disable-intel-soft-cpm)
300 append_cache_entry HAVE_INTEL_SOFT_CPM BOOL false
302 --enable-intel-soft-cpm)
303 append_cache_entry HAVE_INTEL_SOFT_CPM BOOL true
305 --disable-side-channel)
306 append_cache_entry BUILD_SIDE_CHANNEL BOOL false
308 --enable-side-channel)
309 append_cache_entry BUILD_SIDE_CHANNEL BOOL true
311 --disable-unit-tests)
312 append_cache_entry BUILD_UNIT_TESTS BOOL false
315 append_cache_entry BUILD_UNIT_TESTS BOOL true
318 append_cache_entry MAKE_HTML_DOC BOOL false
321 append_cache_entry MAKE_HTML_DOC BOOL true
324 append_cache_entry MAKE_PDF_DOC BOOL false
327 append_cache_entry MAKE_PDF_DOC BOOL true
329 --with-openssl-includes=*)
330 append_cache_entry OPENSSL_INCLUDE_DIR PATH
$optarg
332 --with-openssl-libraries=*)
333 check_and_append_cache_entry OPENSSL_SSL_LIBRARY FILEPATH
$optarg
335 --with-crypto-libraries=*)
336 check_and_append_cache_entry OPENSSL_CRYPTO_LIBRARY FILEPATH
$optarg
338 --with-pcap-includes=*)
339 append_cache_entry PCAP_INCLUDE_DIR PATH
$optarg
341 --with-pcap-libraries=*)
342 append_cache_entry PCAP_LIBRARIES_DIR PATH
$optarg
344 --with-luajit-includes=*)
345 append_cache_entry LUAJIT_INCLUDE_DIR PATH
$optarg
347 --with-luajit-libraries=*)
348 append_cache_entry LUAJIT_LIBRARIES_DIR PATH
$optarg
350 --with-pcre-includes=*)
351 append_cache_entry PCRE_INCLUDE_DIR PATH
$optarg
353 --with-pcre-libraries=*)
354 append_cache_entry PCRE_LIBRARIES_DIR PATH
$optarg
356 --with-dnet-includes=*)
357 append_cache_entry DNET_INCLUDE_DIR PATH
$optarg
359 --with-dnet-libraries=*)
360 append_cache_entry DNET_LIBRARIES_DIR PATH
$optarg
362 --with-daq-includes=*)
363 append_cache_entry DAQ_INCLUDE_DIR PATH
$optarg
365 --with-daq-libraries=*)
366 append_cache_entry DAQ_LIBRARIES_DIR PATH
$optarg
368 # Currently unsupported
369 # --with-intel-soft-cpm-includes=*)
370 # append_cache_entry INTEL_SOFT_CPM_INCLUDE_DIR PATH $optarg
372 # --with-intel-soft-cpm-libraries=*)
373 # append_cache_entry INTEL_SOFT_CPM_LIBRARIES_DIR PATH $optarg
376 append_cache_entry FLEX_EXECUTABLE PATH
$optarg
379 append_cache_entry BISON_EXECUTABLE PATH
$optarg
381 SIGNAL_SNORT_RELOAD
=*)
382 append_cache_entry SIGNAL_SNORT_RELOAD STRING
$optarg
384 SIGNAL_SNORT_DUMP_STATS
=*)
385 append_cache_entry SIGNAL_SNORT_DUMP_STATS STRING
$optarg
387 SIGNAL_SNORT_ROTATE_STATS
=*)
388 append_cache_entry SIGNAL_SNORT_ROTATE_STATS STRING
$optarg
390 SIGNAL_SNORT_READ_ATTR_TBL
=*)
391 append_cache_entry SIGNAL_SNORT_READ_ATTR_TBL STRING
$optarg
394 echo "Invalid option '$1'. Try $0 --help to see available options."
402 if [ -d $builddir ]; then
403 # If build directory exists, check if it has a CMake cache
404 if [ -f $builddir/CMakeCache.txt
]; then
405 # If the CMake cache exists, delete it so that this configuration
406 # is not tainted by a previous one
407 rm -f $builddir/CMakeCache.txt
410 # Create build directory
414 echo "Build Directory : $builddir"
415 echo "Source Directory: $sourcedir"
418 if [ -n "$CMakeGenerator" ]; then
419 cmake
-G "$CMakeGenerator" $CMakeCacheEntries $sourcedir
421 cmake
$CMakeCacheEntries $sourcedir
424 echo "# This is the command used to configure this build" > config.status
425 echo $command >> config.status
426 chmod u
+x config.status