7202f139cc83b4f8182fcaafe8dc88f5c1f83b59
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / nut / 0001-foo-config.patch
1 configure: fix calls to {gdlib,net-snmp}-config
2
3 nut directly calls to {gdlib,net-snmp}-config. In Buildroot,
4 those are not in the PATH, and nut would catch those of the
5 system (if they are installed), or miss them entirely.
6
7 Fix that by using environment variables that will tell where
8 to look for them.
9
10 Note: libusb also uses libusb-config, but only as a fallback
11 if pkg-config fails. Since we ensure that pkg-config exists,
12 and libusb is properly installed before we build nut, there
13 is no need to fix the libusb-config calls, since they won't
14 be called at all.
15
16 Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
17
18 diff -durN nut-2.6.5.orig/m4/nut_check_libgd.m4 nut-2.6.5/m4/nut_check_libgd.m4
19 --- nut-2.6.5.orig/m4/nut_check_libgd.m4        2012-07-31 19:38:56.000000000 +0200
20 +++ nut-2.6.5/m4/nut_check_libgd.m4     2013-11-01 16:24:02.626549810 +0100
21 @@ -20,7 +20,7 @@
22         LIBS="-lgd -lpng -lz -ljpeg -lfreetype -lm -lXpm -lX11"
23  
24         AC_MSG_CHECKING(for gd version via gdlib-config)
25 -       GD_VERSION=`gdlib-config --version 2>/dev/null`
26 +       GD_VERSION=`${GDLIB_CONFIG} --version 2>/dev/null`
27         if test "$?" != "0" -o -z "${GD_VERSION}"; then
28                 GD_VERSION="none"
29         fi
30 @@ -34,9 +34,9 @@
31                 AC_MSG_WARN([[If gd detection fails, upgrade gd or use --with-gd-includes and --with-gd-libs]])
32                 ;;
33         *)
34 -               CFLAGS="`gdlib-config --includes 2>/dev/null`"
35 -               LDFLAGS="`gdlib-config --ldflags 2>/dev/null`"
36 -               LIBS="`gdlib-config --libs 2>/dev/null`"
37 +               CFLAGS="`${GDLIB_CONFIG} --includes 2>/dev/null`"
38 +               LDFLAGS="`${GDLIB_CONFIG} --ldflags 2>/dev/null`"
39 +               LIBS="`${GDLIB_CONFIG} --libs 2>/dev/null`"
40                 ;;
41         esac
42  
43 diff -durN nut-2.6.5.orig/m4/nut_check_libnetsnmp.m4 nut-2.6.5/m4/nut_check_libnetsnmp.m4
44 --- nut-2.6.5.orig/m4/nut_check_libnetsnmp.m4   2012-07-31 19:38:56.000000000 +0200
45 +++ nut-2.6.5/m4/nut_check_libnetsnmp.m4        2013-11-01 16:30:07.398282923 +0100
46 @@ -15,7 +15,7 @@
47  
48         dnl See which version of the Net-SNMP library (if any) is installed
49         AC_MSG_CHECKING(for Net-SNMP version via net-snmp-config)
50 -       SNMP_VERSION=`net-snmp-config --version 2>/dev/null`
51 +       SNMP_VERSION=`${NET_SNMP_CONFIG} --version 2>/dev/null`
52         if test "$?" != "0" -o -z "${SNMP_VERSION}"; then
53                 SNMP_VERSION="none"
54         fi
55 @@ -33,7 +33,7 @@
56                         CFLAGS="${withval}"
57                         ;;
58                 esac
59 -       ], [CFLAGS="`net-snmp-config --base-cflags 2>/dev/null`"])
60 +       ], [CFLAGS="`${NET_SNMP_CONFIG} --base-cflags 2>/dev/null`"])
61         AC_MSG_RESULT([${CFLAGS}])
62  
63         AC_MSG_CHECKING(for Net-SNMP libs)
64 @@ -48,7 +48,7 @@
65                         LIBS="${withval}"
66                         ;;
67                 esac
68 -       ], [LIBS="`net-snmp-config --libs 2>/dev/null`"])
69 +       ], [LIBS="`${NET_SNMP_CONFIG} --libs 2>/dev/null`"])
70         AC_MSG_RESULT([${LIBS}])
71  
72         dnl Check if the Net-SNMP library is usable