File: find_ssdeep.m4

package info (click to toggle)
modsecurity-apache 2.9.3-3%2Bdeb11u2
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 10,856 kB
  • sloc: ansic: 51,388; sh: 4,516; perl: 2,340; cpp: 1,930; makefile: 605; xml: 6
file content (64 lines) | stat: -rw-r--r-- 1,473 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
dnl Check for SSDEEP Libraries
dnl CHECK_SSDEEP(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
dnl Sets:
dnl  SSDEEP_CFLAGS
dnl  SSDEEP_LDFLAGS

AC_DEFUN([CHECK_SSDEEP],
[dnl

SSDEEP_CFLAGS=""
SSDEEP_LDFLAGS=""
SSDEEP_LDADD=""

AC_ARG_WITH(
    ssdeep,
    [AC_HELP_STRING([--with-ssdeep=PATH],[Path to ssdeep prefix])]
    ,, with_ssdeep=yes)

AS_CASE(["${with_ssdeep}"],
    [no], [test_paths=],
    [yes], [test_paths="/usr/ /usr/local/ /usr/local/libfuzzy /usr/local/fuzzy /opt/libfuzzy /opt/fuzzy /opt /opt/local"],
    [test_paths="${with_ssdeep}"])

AS_IF([test "x${test_paths}" != "x"], [
AC_MSG_CHECKING([for ssdeep path])
  
  SSDEEP_LIB_NAME="fuzzy"
  ssdeep_dir=

  if test -z "$withssdeep" -o "$withssdeep" = "yes"; then
    for i in ${test_paths}; do
      if test -f "$i/include/fuzzy.h"; then
        SSDEEP_CFLAGS="-I$i/include"
        ssdeep_dir=$i
      fi
    done
  else
    if test -f "$withssdeep/include/fuzzy.h"; then
      SSDEEP_CFLAGS="-I$withssdeep/include"
      ssdeep_dir=$withssdeep
    fi
  fi

  SSDEEP_LDFLAGS="-L$ssdeep_dir/lib -lfuzzy"
  SSDEEP_LDADD="-lfuzzy"

])  
 
    if test -z "${SSDEEP_CFLAGS}"; then
        AC_MSG_RESULT([no])
	SSDEEP_LDFLAGS=""
	SSDEEP_LDADD=""
       AC_MSG_NOTICE([optional ssdeep library not found])
    else
      SSDEEP_CFLAGS="-DWITH_SSDEEP ${SSDEEP_CFLAGS}"
        AC_MSG_RESULT([${SSDEEP_LDFLAGS} ${SSDEEP_CFLAGS}]) 
    fi 

AC_SUBST(SSDEEP_LDFLAGS)
AC_SUBST(SSDEEP_LDADD)
AC_SUBST(SSDEEP_CFLAGS)


])