[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Insufficient check on pkg-config



Hi,

Cyril Brulebois wrote:

> not sure how you want to solve it, but autoreconf'ing without
> pkg-config installed leads to a bad configure-time error.

Maybe something along these lines?

-- >8 --
Subject: build: Catch attempts to autoreconf without pkg-config installed

The PKG_PROG_PKG_CONFIG macro contains some m4_pattern_forbid rules to
catch unexpanded pkg-config macros, but that doesn't help much if
pkg-config is not installed at aclocal time.  So unexpanded macros
can escape into the configure script, producing errors at configure
time.  Add our own rules to give the user a hint about where to start
towards building dpkg:

 $ autoreconf -is
 configure.ac:119: error: missing some pkg-config macros
       If this token and others are legitimate, please use m4_pattern_allow.
       See the Autoconf documentation.
 autoreconf: /usr/bin/autoconf failed with exit status: 1

While at it, catch unexpanded DPKG_ macros in the same way.

Reported-by: Cyril Brulebois <kibi@debian.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 configure.ac |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 390a868..f8996e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,6 +6,9 @@ AC_CONFIG_SRCDIR([lib/dpkg/dpkg.h])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_AUX_DIR([build-aux])
 
+m4_pattern_forbid([^PKG_[A-Z_]+$], [missing some pkg-config macros])
+m4_pattern_forbid([^_?DPKG_[A-Z_]+$])
+
 AC_USE_SYSTEM_EXTENSIONS
 DPKG_ARCHITECTURE
 
-- 
1.7.5.rc3


Reply to: