diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2013-07-11 22:12:05 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2013-07-11 22:12:05 +0200 |
commit | 1d95f7520fea40c43c9e3ea86b895ca62b51d435 (patch) | |
tree | 0c684e39e00dbf2485f22161659a0dc9c496f52b | |
parent | 3163b713c4dbb0f92be80c57a8c720692e71df7f (diff) |
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 <dborkman@redhat.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r-- | Makefile | 1 | ||||
-rwxr-xr-x | configure | 19 |
2 files changed, 14 insertions, 6 deletions
@@ -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) @@ -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 |