libsuricata-config.in 1.3 KB

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