The following commit has been merged in the master branch:
commit 76044b005784129b5c7faa51cd050c43e861deb6
Author: Guillem Jover <[email protected]>
Date:   Fri Oct 30 14:38:47 2009 +0100

    build: Use pkg-config m4 macros to detect selinux library
    
    Use PKG_PROG_PKG_CONFIG to detect and allow overriding the pkg-config
    binary to use, for example in case of cross-compilation.
    
    Suggested-by: Tollef Fog Heen <[email protected]>

diff --git a/debian/changelog b/debian/changelog
index 5d4c5dc..e6d50e1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -32,6 +32,8 @@ dpkg (1.15.5) UNRELEASED; urgency=low
   * Generate the autoconf version from git to make it easier to see when a
     snapshot version is being used.
   * Add infrastructure for doxygen, for now not installed anywhere.
+  * Allow overriding the pkg-config path to ease cross-compilation.
+    Suggested by Tollef Fog Heen <[email protected]>.
 
   [ Raphaƫl Hertzog ]
   * Add versioned dependency on base-files (>= 5.0.0) to dpkg-dev to ensure
diff --git a/m4/dpkg-libs.m4 b/m4/dpkg-libs.m4
index aefbb2b..f14b82e 100644
--- a/m4/dpkg-libs.m4
+++ b/m4/dpkg-libs.m4
@@ -61,8 +61,9 @@ fi
 # DPKG_LIB_SELINUX
 # ----------------
 # Check for selinux library.
-AC_DEFUN([DPKG_LIB_SELINUX],
-[AC_ARG_VAR([SELINUX_LIBS], [linker flags for selinux library])dnl
+AC_DEFUN([DPKG_LIB_SELINUX], [
+AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+AC_ARG_VAR([SELINUX_LIBS], [linker flags for selinux library])dnl
 AC_ARG_WITH(selinux,
        AS_HELP_STRING([--with-selinux],
                       [use selinux library to set security contexts]))
@@ -70,19 +71,19 @@ if test "x$with_selinux" != "xno"; then
        AC_CHECK_LIB([selinux], [is_selinux_enabled],
                [AC_DEFINE(WITH_SELINUX, 1,
                        [Define to 1 to compile in SELinux support])
-                if test $(pkg-config --exists libselinux); then
+               PKG_CHECK_EXISTS([libselinux], [
                        if test "x$with_selinux" = "xstatic"; then
-                               dpkg_selinux_libs="-Wl,-Bstatic "$(pkg-config 
--static --libs libselinux)" -Wl,-Bdynamic"
+                               dpkg_selinux_libs="-Wl,-Bstatic "$($PKG_CONFIG 
--static --libs libselinux)" -Wl,-Bdynamic"
                        else
-                               dpkg_selinux_libs=$(pkg-config --libs 
libselinux)
+                               dpkg_selinux_libs=$($PKG_CONFIG --libs 
libselinux)
                        fi
-                else
+               ], [
                        if test "x$with_selinux" = "xstatic"; then
                                dpkg_selinux_libs="-Wl,-Bstatic -lselinux 
-lsepol -Wl,-Bdynamic"
                        else
                                dpkg_selinux_libs="-lselinux"
                        fi
-                fi
+               ])
                 SELINUX_LIBS="${SELINUX_LIBS:+$SELINUX_LIBS 
}$dpkg_selinux_libs"
                 with_selinux="yes"],
                [if test -n "$with_selinux"; then

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to