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

[PATCH] build: Fail autoconf if glib development files are missing



It's better to fail autoconf if a developer trying to do a git
checkout does not have prerequisite macros installed, than it
is to generate a broken ./configure.

Reported-by: Richard Parkins <aleph0hpela-suse@yahoo.co.uk>
Signed-off-by: Eric Blake <eblake@redhat.com>
---

Variant 2.  Only one of the two proposed patches is actually needed,
and I don't have a strong preference (patch 1 gives a more cryptic
error message, but I'm not sure patch 2 is any more accurate).

 configure.ac | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure.ac b/configure.ac
index 8714446..d34900a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -262,6 +262,7 @@ AC_CHECK_HEADERS([sys/mount.h],,,
 ]])
 AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/ioctl.h sys/socket.h syslog.h linux/types.h sys/dirent.h sys/uio.h])
 AM_PATH_GLIB_2_0(2.26.0, [HAVE_GLIB=yes], AC_MSG_ERROR([Missing glib]), gthread)
+m4_ifndef([AM_PATH_GLIB_2_0], [m4_fatal([Missing glib 2.0 development files])])

 my_save_cflags="$CFLAGS"
 CFLAGS="-Wdeprecated-declarations -Werror $GLIB_CFLAGS"
-- 
2.14.3


Reply to: