Don't hardcode the pkg-config architecture, allowing crossbuilds
Howdy,
In Debian, there's a concerted effort to ensure crossbuilding works, the person that puts in the most effort on that submitted this patch:
Author: Helmut Grohne <helmutg@debian.org>
Description: FTCBFS: m4/shout.m4 hard codes the build architecture pkg-config
ices2 fails to cross build from source, because it uses the build
architecture pkg-config. The cause is a bad macro in m4/shout.m4. After
fixing it, ices2 cross builds successfully. Please consider applying the
attached patch.
.
Note: I had to remove the setting of PKG_CONFIG_PATH, because Debian's
cross wrapper does not work when PKG_CONFIG_PATH is set. Anyway,
/usr/local/lib/pkgconfig is part of the default search path of
pkg-config, so that should not be a problem.
--- ices2-2.0.2.orig/m4/shout.m4
+++ ices2-2.0.2/m4/shout.m4
@@ -19,22 +19,18 @@
# NB: PKG_CHECK_MODULES exits if pkg-config is unavailable on the target
# system, so we can't use it.
-# seed pkg-config with the default libshout location
-PKG_CONFIG_PATH=${PKG_CONFIG_PATH:-/usr/local/lib/pkgconfig}
-export PKG_CONFIG_PATH
-
# Step 1: Use pkg-config if available
-AC_PATH_PROG([PKGCONFIG], [pkg-config], [no])
-if test "$PKGCONFIG" != "no" && `$PKGCONFIG --exists shout`
+PKG_PROG_PKG_CONFIG
+if test "x$PKG_CONFIG" != x && `$PKG_CONFIG --exists shout`
then
- SHOUT_CFLAGS=`$PKGCONFIG --variable=cflags_only shout`
- SHOUT_CPPFLAGS=`$PKGCONFIG --variable=cppflags shout`
- SHOUT_LIBS=`$PKGCONFIG --libs shout`
+ SHOUT_CFLAGS=`$PKG_CONFIG --variable=cflags_only shout`
+ SHOUT_CPPFLAGS=`$PKG_CONFIG --variable=cppflags shout`
+ SHOUT_LIBS=`$PKG_CONFIG --libs shout`
xt_have_shout="maybe"
else
- if test "$PKGCONFIG" != "no"
+ if test "x$PKG_CONFIG" != x
then
- AC_MSG_NOTICE([$PKGCONFIG couldn't find libshout. Try adjusting PKG_CONFIG_PATH.])
+ AC_MSG_NOTICE([$PKG_CONFIG couldn't find libshout. Try adjusting PKG_CONFIG_PATH.])
fi
# pkg-config unavailable, try shout-config
AC_PATH_PROG([SHOUTCONFIG], [shout-config], [no])
This technically applies to the m4 module, which is to have issues filed in icecast-server.
Thanks!