]> git.ipfire.org Git - people/ms/suricata.git/blame - libsuricata-config.in
detect: allows <> syntax for uint ranges
[people/ms/suricata.git] / libsuricata-config.in
CommitLineData
dfd930a1
JI
1#! /bin/sh
2
3prefix="@prefix@"
4exec_prefix="@exec_prefix@"
5includedir="@includedir@"
6libdir="@libdir@"
7LIBS="@LIBS@ @RUST_LDADD@"
8
9shared_lib="-lsuricata"
10static_lib="-lsuricata_c -lsuricata_rust"
11
12enable_non_bundled_htp="@enable_non_bundled_htp@"
13
14lib="$shared_lib"
15
16show_libs="no"
17show_cflags="no"
18use_static="no"
19
20if [ "$#" = 0 ]; then
21 echo "usage: suricata-config [--cflags] [--libs] [--static]"
22 exit 0
23fi
24
25while [ "$#" != 0 ]
26do
27 case "$1" in
28 --libs)
29 show_libs="yes"
30 ;;
31 --cflags)
32 show_cflags="yes"
33 ;;
34 --static)
35 lib="$static_lib"
36 use_status="yes"
37 ;;
38 esac
39 shift
40done
41
42# If --static wasn't provided, use the static library if the shared
43# library is not available.
44if [ "$use_static" = "no" ]; then
45 if ! test -e "$libdir/libsuricata.so"; then
46 lib="$static_lib"
47 fi
48fi
49
50# If we're using a bundled htp, add it to the libs as well. It will
51# already be present if we're use a non-bundled libhtp.
52if [ "$enable_non_bundled_htp" = "no" ]; then
53 lib="${lib} -lhtp"
54fi
55
56output=""
57
58if [ "$show_cflags" = "yes" ]; then
59 output="${output} -DHAVE_CONFIG_H -I$includedir/suricata"
60fi
61
62if [ "$show_libs" = "yes" ]; then
63 output="${output} -L$libdir $lib $LIBS"
64fi
65
66echo "$output"