summaryrefslogtreecommitdiffstats
path: root/ssdeep.patch
blob: ed37070c7d9bf0b62bdbb2022217f0e934769ef6 (plain)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
From 8c82ad02f89aa46ff772e676fda83d31e58fc8e8 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@php.net>
Date: Wed, 22 Jan 2014 09:06:11 +0100
Subject: [PATCH] Improves libfuzzy detection - honour --with-libdir option

Allow to use --with-ssdeep=/usr, and find:
- lib in /usr/lib64
- inc in /usr/include
---
 ax_libssdeep.m4 | 37 ++++++++++++++++++-------------------
 1 file changed, 18 insertions(+), 19 deletions(-)

diff --git a/ax_libssdeep.m4 b/ax_libssdeep.m4
index 93561f9..d948f99 100644
--- a/ax_libssdeep.m4
+++ b/ax_libssdeep.m4
@@ -28,6 +28,7 @@ AC_DEFUN([AX_SSDEEP], [
 
   SSDEEP_LIB_NAME="fuzzy"
   SSDEEP_LIB_FILENAME="lib$SSDEEP_LIB_NAME.$LIB_EXTENSION"
+  SSDEEP_LIBDIR=${PHP_LIBDIR-lib}
 
   if test -z "$withssdeep" -o "$withssdeep" = "yes"; then
     for i in /usr/lib /usr/local/lib; do
@@ -40,16 +41,16 @@ AC_DEFUN([AX_SSDEEP], [
     fi
   elif test "$withssdeep" = "no"; then
     AC_MSG_ERROR(["Cannot build whilst ssdeep is disabled."])
+  elif test -f "$withssdeep/$SSDEEP_LIB_FILENAME"; then
+    SSDEEP_LIB_DIR="$withssdeep"
+  elif test -f "$withssdeep/$SSDEEP_LIBDIR/$SSDEEP_LIB_FILENAME"; then
+    SSDEEP_LIB_DIR="$withssdeep/$SSDEEP_LIBDIR"
+  elif test -f "$withssdeep/$SSDEEP_LIB_FILENAME"; then
+    SSDEEP_LIB_DIR="$withssdeep"
+  elif test -f "$withssdeep/.libs/$SSDEEP_LIB_FILENAME"; then
+    SSDEEP_LIB_DIR="$withssdeep/.libs/"
   else
-    if test -f "$withssdeep/$SSDEEP_LIB_FILENAME"; then
-      SSDEEP_LIB_DIR="$withssdeep"
-    else
-      if test -f "$withssdeep/.libs/$SSDEEP_LIB_FILENAME"; then
-        SSDEEP_LIB_DIR="$withssdeep/.libs/"
-      else
-        AC_MSG_ERROR(["Could not find ssdeep library '$withssdeep/.libs/$SSDEEP_LIB_FILENAME'. Try specifying the path to the ssdeep build directory."])
-      fi
-    fi
+    AC_MSG_ERROR(["Could not find ssdeep library '$withssdeep/.libs/$SSDEEP_LIB_FILENAME'. Try specifying the path to the ssdeep build directory."])
   fi
 
   SSDEEP_LIBDIR="-L$SSDEEP_LIB_DIR"
@@ -65,22 +66,20 @@ AC_DEFUN([AX_SSDEEP], [
     if test "$SSDEEP_INCLUDEDIR" = ""; then
       AC_MSG_ERROR(["Could not find ssdeep '$SSDEEP_LIB_NAME.h' header file. Try specifying the path to the ssdeep build directory."])
     fi
+  elif test -f "$withssdeep/../$SSDEEP_LIB_NAME.h"; then
+    SSDEEP_INCLUDEDIR="$withssdeep/../"
+  elif test -f "$withssdeep/include/$SSDEEP_LIB_NAME.h"; then
+    SSDEEP_INCLUDEDIR="$withssdeep/include/"
+  elif test -f "$withssdeep/$SSDEEP_LIB_NAME.h"; then
+    SSDEEP_INCLUDEDIR="$withssdeep"
   else
-    if test -f "$withssdeep/../$SSDEEP_LIB_NAME.h"; then
-      SSDEEP_INCLUDEDIR="$withssdeep/../"
-    else
-      if test -f "$withssdeep/$SSDEEP_LIB_NAME.h"; then
-        SSDEEP_INCLUDEDIR="$withssdeep"
-      else
-        AC_MSG_ERROR(["Could not find ssdeep '$SSDEEP_LIB_NAME.h' header file. Try specifying the path to the ssdeep build directory."])
-      fi
-    fi
+    AC_MSG_ERROR(["Could not find ssdeep '$SSDEEP_LIB_NAME.h' header file. Try specifying the path to the ssdeep build directory."])
   fi
   
   SSDEEP_INCLUDEDIR_NO_FLAG="$SSDEEP_INCLUDEDIR"
   SSDEEP_INCLUDEDIR="-I$SSDEEP_INCLUDEDIR"
 
-  AC_MSG_RESULT([$SSDEEP_LIB_DIR])
+  AC_MSG_RESULT([$SSDEEP_LIB_DIR, $SSDEEP_INCLUDEDIR_NO_FLAG])
     
   AC_DEFINE([SSDEEP_ENABLED], [1], [Enables ssdeep])
   
-- 
1.8.4.3