From 1d95f7520fea40c43c9e3ea86b895ca62b51d435 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 11 Jul 2013 22:12:05 +0200 Subject: configure: Redirect pkg-config errors to log file If pkg-config doesn't find a library it prints an error to stderr. Instead of directly printing them as part of the configure output, redirect them to config.log and let the user know about it in case there are any messages. Suggested-by: Daniel Borkmann Signed-off-by: Tobias Klauser --- Makefile | 1 + configure | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index b19b555..7b3e85c 100644 --- a/Makefile +++ b/Makefile @@ -210,6 +210,7 @@ clean: $(foreach tool,$(TOOLS),$(tool)_clean) distclean: clean $(Q)$(call RM,Config) $(Q)$(call RM,config.h) + $(Q)$(call RM,config.log) mrproper: distclean $(Q)$(GIT_REM) diff --git a/configure b/configure index d32bdb7..13da36d 100755 --- a/configure +++ b/configure @@ -160,12 +160,12 @@ void main(void) EOF $CC \ - $(pkg-config --cflags libnl-3.0) \ - $(pkg-config --cflags libnl-genl-3.0) \ + $(pkg-config --cflags libnl-3.0 2>>config.log) \ + $(pkg-config --cflags libnl-genl-3.0 2>>config.log) \ -o $TMPDIR/libnltest \ $TMPDIR/libnltest.c \ - $(pkg-config --libs libnl-3.0) \ - $(pkg-config --libs libnl-genl-3.0) \ + $(pkg-config --libs libnl-3.0 2>>config.log) \ + $(pkg-config --libs libnl-genl-3.0 2>>config.log) \ >> $TMPDIR/config.log 2>&1 if [ ! -x $TMPDIR/libnltest ] ; then echo "[NO]" @@ -255,9 +255,9 @@ void main(void) EOF $CC \ - $(pkg-config --cflags ncurses) \ + $(pkg-config --cflags ncurses 2>>config.log) \ -o $TMPDIR/ncursestest $TMPDIR/ncursestest.c \ - $(pkg-config --libs ncurses) \ + $(pkg-config --libs ncurses 2>>config.log) \ >> $TMPDIR/config.log 2>&1 if [ ! -x $TMPDIR/ncursestest ] ; then echo "[NO]" @@ -548,6 +548,8 @@ $_have_hwts EOF } +rm -f config.log + echo "# This file is autogenerated by the configure script" > Config check_pkg_config @@ -597,6 +599,11 @@ else echo "[*] Looks good! All tools will be built!" fi +if [ -s config.log ] ; then + echo "[!] There were errors in the configure script. Please see" + echo " the file config.log for details." +fi + if [ "$HAVE_LIBGEOIP" == "1" -a "$HAVE_LIBZ" == "1" ] ; then echo "CONFIG_GEOIP=1" >> Config else -- cgit v1.2.3-54-g00ecf