The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / systemd / 0003-fix-am-path-libgcrypt-no-found.patch
1 Fix AM_PATH_LIBGCRYPT not found
2
3 This patch installs a copy of libgcrypt.m4 from the libgcrypt source tarball
4 to systemd m4 directory.
5
6 Libgcrypt uses a custom m4 macro and not pkg-config to check if the
7 development files are available. Though libgcrypt support is optional in
8 systemd, this macro should be available whenever autoreconf is used, otherwise
9 the re-configuration will fail with:
10
11   configure.ac:616: warning: macro 'AM_PATH_LIBGCRYPT' not found in library
12
13 As asking the user to install the development package of libgcrypt on the host
14 machine or adding libgcrypt as a build dependency to systemd is not
15 acceptable, the required file is added to the m4 directory.
16
17 Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
18 Index: systemd-213/m4/libgcrypt.m4
19 ===================================================================
20 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
21 +++ systemd-213/m4/libgcrypt.m4 2014-06-11 10:41:11.749305509 +0200
22 @@ -0,0 +1,123 @@
23 +dnl Autoconf macros for libgcrypt
24 +dnl       Copyright (C) 2002, 2004 Free Software Foundation, Inc.
25 +dnl
26 +dnl This file is free software; as a special exception the author gives
27 +dnl unlimited permission to copy and/or distribute it, with or without
28 +dnl modifications, as long as this notice is preserved.
29 +dnl
30 +dnl This file is distributed in the hope that it will be useful, but
31 +dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
32 +dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
33 +
34 +
35 +dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION,
36 +dnl                   [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
37 +dnl Test for libgcrypt and define LIBGCRYPT_CFLAGS and LIBGCRYPT_LIBS.
38 +dnl MINIMUN-VERSION is a string with the version number optionalliy prefixed
39 +dnl with the API version to also check the API compatibility. Example:
40 +dnl a MINIMUN-VERSION of 1:1.2.5 won't pass the test unless the installed
41 +dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1.  Using
42 +dnl this features allows to prevent build against newer versions of libgcrypt
43 +dnl with a changed API.
44 +dnl
45 +AC_DEFUN([AM_PATH_LIBGCRYPT],
46 +[ AC_ARG_WITH(libgcrypt-prefix,
47 +            AC_HELP_STRING([--with-libgcrypt-prefix=PFX],
48 +                           [prefix where LIBGCRYPT is installed (optional)]),
49 +     libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="")
50 +  if test x$libgcrypt_config_prefix != x ; then
51 +     if test x${LIBGCRYPT_CONFIG+set} != xset ; then
52 +        LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config
53 +     fi
54 +  fi
55 +
56 +  AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, no)
57 +  tmp=ifelse([$1], ,1:1.2.0,$1)
58 +  if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
59 +     req_libgcrypt_api=`echo "$tmp"     | sed 's/\(.*\):\(.*\)/\1/'`
60 +     min_libgcrypt_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'`
61 +  else
62 +     req_libgcrypt_api=0
63 +     min_libgcrypt_version="$tmp"
64 +  fi
65 +
66 +  AC_MSG_CHECKING(for LIBGCRYPT - version >= $min_libgcrypt_version)
67 +  ok=no
68 +  if test "$LIBGCRYPT_CONFIG" != "no" ; then
69 +    req_major=`echo $min_libgcrypt_version | \
70 +               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
71 +    req_minor=`echo $min_libgcrypt_version | \
72 +               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
73 +    req_micro=`echo $min_libgcrypt_version | \
74 +               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
75 +    libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
76 +    major=`echo $libgcrypt_config_version | \
77 +               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
78 +    minor=`echo $libgcrypt_config_version | \
79 +               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
80 +    micro=`echo $libgcrypt_config_version | \
81 +               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
82 +    if test "$major" -gt "$req_major"; then
83 +        ok=yes
84 +    else
85 +        if test "$major" -eq "$req_major"; then
86 +            if test "$minor" -gt "$req_minor"; then
87 +               ok=yes
88 +            else
89 +               if test "$minor" -eq "$req_minor"; then
90 +                   if test "$micro" -ge "$req_micro"; then
91 +                     ok=yes
92 +                   fi
93 +               fi
94 +            fi
95 +        fi
96 +    fi
97 +  fi
98 +  if test $ok = yes; then
99 +    AC_MSG_RESULT([yes ($libgcrypt_config_version)])
100 +  else
101 +    AC_MSG_RESULT(no)
102 +  fi
103 +  if test $ok = yes; then
104 +     # If we have a recent libgcrypt, we should also check that the
105 +     # API is compatible
106 +     if test "$req_libgcrypt_api" -gt 0 ; then
107 +        tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
108 +        if test "$tmp" -gt 0 ; then
109 +           AC_MSG_CHECKING([LIBGCRYPT API version])
110 +           if test "$req_libgcrypt_api" -eq "$tmp" ; then
111 +             AC_MSG_RESULT([okay])
112 +           else
113 +             ok=no
114 +             AC_MSG_RESULT([does not match. want=$req_libgcrypt_api got=$tmp])
115 +           fi
116 +        fi
117 +     fi
118 +  fi
119 +  if test $ok = yes; then
120 +    LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
121 +    LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
122 +    ifelse([$2], , :, [$2])
123 +    if test x"$host" != x ; then
124 +      libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none`
125 +      if test x"$libgcrypt_config_host" != xnone ; then
126 +        if test x"$libgcrypt_config_host" != x"$host" ; then
127 +  AC_MSG_WARN([[
128 +***
129 +*** The config script $LIBGCRYPT_CONFIG was
130 +*** built for $libgcrypt_config_host and thus may not match the
131 +*** used host $host.
132 +*** You may want to use the configure option --with-libgcrypt-prefix
133 +*** to specify a matching config script.
134 +***]])
135 +        fi
136 +      fi
137 +    fi
138 +  else
139 +    LIBGCRYPT_CFLAGS=""
140 +    LIBGCRYPT_LIBS=""
141 +    ifelse([$3], , :, [$3])
142 +  fi
143 +  AC_SUBST(LIBGCRYPT_CFLAGS)
144 +  AC_SUBST(LIBGCRYPT_LIBS)
145 +])