diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2014-03-05 09:36:47 +0000 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2014-03-05 09:36:47 +0000 |
commit | 23b2f4065567d0d7ebd6edb728f6ef53b053d12d (patch) | |
tree | 05b9aa2121b245b2bb0f6b0cee31d58911509395 /m4 | |
parent | 944459d6c6cc2f74ddb38dcb47ec370a38f4ff18 (diff) | |
download | libmicrohttpd-23b2f4065567d0d7ebd6edb728f6ef53b053d12d.tar.gz libmicrohttpd-23b2f4065567d0d7ebd6edb728f6ef53b053d12d.zip |
Updated m4/libgcrypt.m4 to use $SED and $GREP instead of hardcoded names
Diffstat (limited to 'm4')
-rw-r--r-- | m4/libgcrypt.m4 | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/m4/libgcrypt.m4 b/m4/libgcrypt.m4 index 6cf482fc..75863ba9 100644 --- a/m4/libgcrypt.m4 +++ b/m4/libgcrypt.m4 | |||
@@ -1,5 +1,6 @@ | |||
1 | dnl Autoconf macros for libgcrypt | 1 | dnl Autoconf macros for libgcrypt |
2 | dnl Copyright (C) 2002, 2004, 2011 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2002, 2004, 2011 Free Software Foundation, Inc. |
3 | dnl Copyright (C) 2014 Karlson2k (Evgeny Grin) | ||
3 | dnl | 4 | dnl |
4 | dnl This file is free software; as a special exception the author gives | 5 | dnl This file is free software; as a special exception the author gives |
5 | dnl unlimited permission to copy and/or distribute it, with or without | 6 | dnl unlimited permission to copy and/or distribute it, with or without |
@@ -20,8 +21,12 @@ dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1. Using | |||
20 | dnl this features allows to prevent build against newer versions of libgcrypt | 21 | dnl this features allows to prevent build against newer versions of libgcrypt |
21 | dnl with a changed API. | 22 | dnl with a changed API. |
22 | dnl | 23 | dnl |
24 | dnl Updated by Karlson2k to be more tolerant to host tools variations. | ||
25 | dnl | ||
23 | AC_DEFUN([AM_PATH_LIBGCRYPT], | 26 | AC_DEFUN([AM_PATH_LIBGCRYPT], |
24 | [ AC_REQUIRE([AC_CANONICAL_HOST]) | 27 | [ AC_REQUIRE([AC_CANONICAL_HOST]) |
28 | AC_REQUIRE([AC_PROG_GREP]) | ||
29 | AC_REQUIRE([AC_PROG_SED]) | ||
25 | AC_ARG_WITH(libgcrypt-prefix, | 30 | AC_ARG_WITH(libgcrypt-prefix, |
26 | AC_HELP_STRING([--with-libgcrypt-prefix=PFX], | 31 | AC_HELP_STRING([--with-libgcrypt-prefix=PFX], |
27 | [prefix where LIBGCRYPT is installed (optional)]), | 32 | [prefix where LIBGCRYPT is installed (optional)]), |
@@ -34,9 +39,9 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], | |||
34 | 39 | ||
35 | AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, no) | 40 | AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, no) |
36 | tmp=ifelse([$1], ,1:1.2.0,$1) | 41 | tmp=ifelse([$1], ,1:1.2.0,$1) |
37 | if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then | 42 | if echo "$tmp" | $GREP ':' >/dev/null 2>/dev/null ; then |
38 | req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` | 43 | req_libgcrypt_api=`echo "$tmp" | $SED 's/\(.*\):\(.*\)/\1/'` |
39 | min_libgcrypt_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'` | 44 | min_libgcrypt_version=`echo "$tmp" | $SED 's/\(.*\):\(.*\)/\2/'` |
40 | else | 45 | else |
41 | req_libgcrypt_api=0 | 46 | req_libgcrypt_api=0 |
42 | min_libgcrypt_version="$tmp" | 47 | min_libgcrypt_version="$tmp" |
@@ -46,18 +51,18 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], | |||
46 | ok=no | 51 | ok=no |
47 | if test "$LIBGCRYPT_CONFIG" != "no" ; then | 52 | if test "$LIBGCRYPT_CONFIG" != "no" ; then |
48 | req_major=`echo $min_libgcrypt_version | \ | 53 | req_major=`echo $min_libgcrypt_version | \ |
49 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` | 54 | $SED 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` |
50 | req_minor=`echo $min_libgcrypt_version | \ | 55 | req_minor=`echo $min_libgcrypt_version | \ |
51 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` | 56 | $SED 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` |
52 | req_micro=`echo $min_libgcrypt_version | \ | 57 | req_micro=`echo $min_libgcrypt_version | \ |
53 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` | 58 | $SED 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` |
54 | libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version` | 59 | libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version` |
55 | major=`echo $libgcrypt_config_version | \ | 60 | major=`echo $libgcrypt_config_version | \ |
56 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` | 61 | $SED 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` |
57 | minor=`echo $libgcrypt_config_version | \ | 62 | minor=`echo $libgcrypt_config_version | \ |
58 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` | 63 | $SED 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` |
59 | micro=`echo $libgcrypt_config_version | \ | 64 | micro=`echo $libgcrypt_config_version | \ |
60 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'` | 65 | $SED 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'` |
61 | if test "$major" -gt "$req_major"; then | 66 | if test "$major" -gt "$req_major"; then |
62 | ok=yes | 67 | ok=yes |
63 | else | 68 | else |