Skip to content

Commit 26a56f6

Browse files
committed
nut_check_libneon.m4 : provide fallback defaults when pkg-config fails
1 parent dff7fb1 commit 26a56f6

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

m4/nut_check_libneon.m4

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ if test -z "${nut_have_neon_seen}"; then
1717
AC_MSG_CHECKING(for libneon version via pkg-config (0.25.0 minimum required))
1818
NEON_VERSION="`pkg-config --silence-errors --modversion neon 2>/dev/null`"
1919
if test "$?" != "0" -o -z "${NEON_VERSION}"; then
20+
AC_MSG_WARN([could not get pkg-config information for libneon version, using fallback defaults])
2021
NEON_VERSION="none"
2122
fi
2223
AC_MSG_RESULT(${NEON_VERSION} found)
@@ -33,7 +34,11 @@ if test -z "${nut_have_neon_seen}"; then
3334
CFLAGS="${withval}"
3435
;;
3536
esac
36-
], [CFLAGS="`pkg-config --silence-errors --cflags neon 2>/dev/null`"])
37+
], [CFLAGS="`pkg-config --silence-errors --cflags neon 2>/dev/null`"
38+
if test "$?" != 0 ; then
39+
AC_MSG_WARN([could not get pkg-config information for libneon cflags, using fallback defaults])
40+
CFLAGS="-I/usr/include/neon"
41+
fi])
3742
AC_MSG_RESULT([${CFLAGS}])
3843
3944
AC_MSG_CHECKING(for libneon ldflags)
@@ -48,7 +53,11 @@ if test -z "${nut_have_neon_seen}"; then
4853
LIBS="${withval}"
4954
;;
5055
esac
51-
], [LIBS="`pkg-config --silence-errors --libs neon 2>/dev/null`"])
56+
], [LIBS="`pkg-config --silence-errors --libs neon 2>/dev/null`"
57+
if test "$?" != 0 ; then
58+
AC_MSG_WARN([could not get pkg-config information for libneon libs, using fallback defaults])
59+
LIBS="-lneon"
60+
fi])
5261
AC_MSG_RESULT([${LIBS}])
5362
5463
dnl check if neon is usable

0 commit comments

Comments
 (0)