From eb61e891ae49e2a68a62aab4b77e90cf53ba50b1 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Fri, 14 Nov 2014 10:56:02 -0800 Subject: [PATCH] Build: New alternative to identify the presence of libfuzzy Searching for the fuzzy.h instead of the .so file. --- build/find_ssdeep.m4 | 41 +++++++++-------------------------------- 1 file changed, 9 insertions(+), 32 deletions(-) diff --git a/build/find_ssdeep.m4 b/build/find_ssdeep.m4 index 8279a452..3f298bcc 100644 --- a/build/find_ssdeep.m4 +++ b/build/find_ssdeep.m4 @@ -18,62 +18,39 @@ AC_ARG_WITH( AS_CASE(["${with_ssdeep}"], [no], [test_paths=], - [yes], [test_paths="/usr/lib /usr/local/lib /usr/local/libfuzzy /usr/local/fuzzy /usr/local /opt/libfuzzy /opt/fuzzy /opt /usr"]) - [test_paths="${with_ssdeep}"], + [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_LIB_FILENAME="lib$SSDEEP_LIB_NAME.so" if test -z "$withssdeep" -o "$withssdeep" = "yes"; then for i in ${test_paths}; do - if test -f "$i/$SSDEEP_LIB_FILENAME"; then - SSDEEP_LIB_DIR="$i" - fi - done - 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/" - fi - fi - fi - - SSDEEP_LDFLAGS="-l$SSDEEP_LIB_NAME" - SSDEEP_LDADD="-l$SSDEEP_LIB_NAME" - - if test -z "$withssdeep" -o "$withssdeep" = "yes"; then - for i in /usr/include /usr/local/include; do - if test -f "$i/$SSDEEP_LIB_NAME.h"; then + if test -f "$i/include/fuzzy.h"; then SSDEEP_CFLAGS="-I$i" fi done else - if test -f "$withssdeep/../$SSDEEP_LIB_NAME.h"; then - SSDEEP_CFLAGS="-I$withssdeep/../" - else - if test -f "$withssdeep/$SSDEEP_LIB_NAME.h"; then - SSDEEP_CFLAGS="-I$withssdeep" - fi + if test -f "$withssdeep/include/fuzzy.h"; then + SSDEEP_CFLAGS="-I$i" fi fi + SSDEEP_LDFLAGS="-lfuzzy" + SSDEEP_LDADD="-lfuzzy" + ]) if test -z "${SSDEEP_CFLAGS}"; then AC_MSG_RESULT([no]) SSDEEP_LDFLAGS="" SSDEEP_LDADD="" - #ifelse([$2], , AC_MSG_NOTICE([optional ssdeep library not found]), $2) + AC_MSG_NOTICE([optional ssdeep library not found]) else SSDEEP_CFLAGS="-DWITH_SSDEEP ${SSDEEP_CFLAGS}" AC_MSG_RESULT([${SSDEEP_LDFLAGS} ${SSDEEP_CFLAGS}]) -#AC_MSG_NOTICE([using ssdeep: ${SSDEEP_CFLAGS} ${SSDEEP_LDFLAGS}]) -#ifelse([$1], , , $1) fi AC_SUBST(SSDEEP_LDFLAGS)