You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by sh...@apache.org on 2019/04/01 19:04:22 UTC
[trafficserver] branch master updated: Fix the hiredis autoconf for
the default case
This is an automated email from the ASF dual-hosted git repository.
shinrich pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 0b33066 Fix the hiredis autoconf for the default case
0b33066 is described below
commit 0b33066f6977c11c973917ef05eb51e207ca7db7
Author: Susan Hinrichs <sh...@oath.com>
AuthorDate: Mon Apr 1 14:49:44 2019 +0000
Fix the hiredis autoconf for the default case
---
build/hiredis.m4 | 54 +++++++++++++++++++++---------------------------------
1 file changed, 21 insertions(+), 33 deletions(-)
diff --git a/build/hiredis.m4 b/build/hiredis.m4
index e49ad79..871df83 100644
--- a/build/hiredis.m4
+++ b/build/hiredis.m4
@@ -24,34 +24,33 @@ dnl
AC_DEFUN([TS_CHECK_HIREDIS], [
hiredis_base_dir='/usr'
-has_hiredis=0
+has_hiredis=1
AC_ARG_WITH(hiredis, [AC_HELP_STRING([--with-hiredis=DIR],[use a specific hiredis library])],
[
- has_hiredis=1
if test "x$withval" != "xyes" && test "x$withval" != "x"; then
hiredis_base_dir="$withval"
- if test "$withval" != "no"; then
- case "$withval" in
- *":"*)
- hiredis_include="`echo $withval |sed -e 's/:.*$//'`"
- hiredis_ldflags="`echo $withval |sed -e 's/^.*://'`"
- AC_MSG_CHECKING(checking for hiredis includes in $hiredis_include libs in $hiredis_ldflags )
- ;;
- *)
- hiredis_include="$withval/include"
- hiredis_ldflags="$withval/lib"
- AC_MSG_CHECKING(checking for hiredis includes in $withval)
- ;;
- esac
- fi
fi
+],[])
- if test -d $hiredis_include && test -d $hiredis_ldflags && test -f $hiredis_include/hiredis/hiredis.h; then
- AC_MSG_RESULT([ok])
- else
- has_hiredis=0
- AC_MSG_RESULT([not found])
- fi
+case "$hiredis_base_dir" in
+*":"*)
+ hidredis_include="`echo $hiredis_base_dir |sed -e 's/:.*$//'`"
+ hiredis_ldflags="`echo $hiredis_base_dir |sed -e 's/^.*://'`"
+ AC_MSG_CHECKING(checking for hiredis includes in $hiredis_include libs in $hiredis_ldflags )
+ ;;
+*)
+ hiredis_include="$hiredis_base_dir/include"
+ hiredis_ldflags="$hiredis_base_dir/lib"
+ AC_MSG_CHECKING(checking for hiredis includes in $hiredis_base_dir)
+ ;;
+esac
+
+if test -d $hiredis_include && test -d $hiredis_ldflags && test -f $hiredis_include/hiredis/hiredis.h; then
+ AC_MSG_RESULT([ok])
+else
+ has_hiredis=0
+ AC_MSG_RESULT([not found])
+fi
if test "$has_hiredis" != "0"; then
saved_ldflags=$LDFLAGS
@@ -77,17 +76,6 @@ if test "$has_hiredis" != "0"; then
LDFLAGS=$saved_ldflags
fi
fi
-],
-[
-has_hiredis=1
-AC_CHECK_HEADER([hiredis/hiredis.h], [], [has_hiredis=0])
-AC_CHECK_LIB([hiredis], redisConnect, [], [has_hiredis=0])
-
-if test "x$has_hiredis" == "x1"; then
- AC_SUBST([LIB_HIREDIS], [-lhiredis])
-fi
-])
-
])