summaryrefslogtreecommitdiff
path: root/gr-howto-write-a-block/config/pkg.m4
diff options
context:
space:
mode:
authorTom Rondeau2011-03-20 12:31:10 -0400
committerTom Rondeau2011-03-20 12:31:10 -0400
commit972fc99ad6984e50731ec0dd97ccfec71829139b (patch)
treedcbbe06ca254169c122b88600816e504643880dc /gr-howto-write-a-block/config/pkg.m4
parent3c3aff088447942053e96ae30b766b00d4cd0202 (diff)
parent4d1426b8db5be20583a6efb380d564a55a28fd09 (diff)
downloadgnuradio-972fc99ad6984e50731ec0dd97ccfec71829139b.tar.gz
gnuradio-972fc99ad6984e50731ec0dd97ccfec71829139b.tar.bz2
gnuradio-972fc99ad6984e50731ec0dd97ccfec71829139b.zip
Merge branch 'master' of gnuradio.org:gnuradio
Diffstat (limited to 'gr-howto-write-a-block/config/pkg.m4')
-rw-r--r--gr-howto-write-a-block/config/pkg.m419
1 files changed, 16 insertions, 3 deletions
diff --git a/gr-howto-write-a-block/config/pkg.m4 b/gr-howto-write-a-block/config/pkg.m4
index 80bdfed4c..2d4d96109 100644
--- a/gr-howto-write-a-block/config/pkg.m4
+++ b/gr-howto-write-a-block/config/pkg.m4
@@ -111,8 +111,11 @@ fi[]dnl
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
#
# --------------------------------------------------------------
-AC_DEFUN([PKG_CHECK_MODULES],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_DEFUN([PKG_CHECK_MODULES],[
+AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_INCLUDEDIR], [includedir for $1, overriding pkg-config])dnl
@@ -124,7 +127,17 @@ _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
if test x$cross_compiling = xyes
then
- _PKG_CONFIG([$1][_LIBS], [libs-only-l --static], [$2])
+ dnl _PKG_CONFIG([$1][_LIBS], [libs-only-l --static], [$2])
+ _PKG_CONFIG([$1][_LIBS], [libs --static], [$2])
+ dnl prune out any -L/lib or -L/usr/lib since they're pointing to the wrong filesystem root
+ _pkg_tmp=
+ for flag in [$]pkg_cv_[$1][_LIBS]; do
+ case $flag in
+ (-L/lib* | -L/usr/lib* ) ;; # ignore
+ (*) _pkg_tmp="$_pkg_tmp $flag" ;;
+ esac
+ done
+ pkg_cv_[$1][_LIBS]="$_pkg_tmp"
else
_PKG_CONFIG([$1][_LIBS], [libs --static], [$2])
fi