acinclude: better fix for pkg-config 0.28 behaviour

Old pkg-config always retured a non-empty string for --cflags.
It always contained at least one bogus space. New pkg-config
does not do that. Do not rely on --cflags being non-empty.
This commit is contained in:
Stefan Seyfried
2013-04-27 22:02:02 +02:00
parent 8381f1a8cf
commit 79184569fc
2 changed files with 4 additions and 3 deletions

View File

@@ -268,6 +268,7 @@ if $PKG_CONFIG --exists "$2" ; then
AC_MSG_RESULT(yes)
$1_CFLAGS=$($PKG_CONFIG --cflags "$2")
$1_LIBS=$($PKG_CONFIG --libs "$2")
$1_EXISTS=yes
else
AC_MSG_RESULT(no)
fi
@@ -278,7 +279,7 @@ AC_SUBST($1_LIBS)
AC_DEFUN([TUXBOX_APPS_LIB_PKGCONFIG],[
_TUXBOX_APPS_LIB_PKGCONFIG($1,$2)
if test -z "$$1_CFLAGS" && test -z "$$1_LIBS"; then
if test x"$$1_EXISTS" != xyes; then
AC_MSG_ERROR([could not find package $2]);
fi
])

View File

@@ -46,11 +46,11 @@ TUXBOX_APPS_LIB_CONFIG(CURL,curl-config)
TUXBOX_APPS_LIB_CONFIG(FREETYPE,freetype-config)
# TUXBOX_APPS_LIB_PKGCONFIG(OPENSSL,openssl)
TUXBOX_APPS_LIB_PKGCONFIG_CHECK(ID3TAG,libid3tag)
if test -z "$ID3TAG_CFLAGS" ; then
if test x"$ID3TAG_EXISTS" != xyes; then
TUXBOX_APPS_LIB_PKGCONFIG(ID3TAG,id3tag)
fi
TUXBOX_APPS_LIB_PKGCONFIG_CHECK(MAD,libmad)
if test -z "$MAD_CFLAGS" ; then
if test x"$MAD_EXISTS" != xyes; then
TUXBOX_APPS_LIB_PKGCONFIG(MAD,mad)
fi
TUXBOX_APPS_LIB_PKGCONFIG(PNG,libpng)