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

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



On Mon, Dec 18, 2017 at 02:05:09PM -0600, Eric Blake wrote:
> 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).

This looks better, yeah.

(I was thinking of changing the check to PKG_CHECK_MODULES first,
though; that has the advantage of (a) it being less likely to fail,
since pkg-config is more likely to be already installed on a development
system, and (b) the name "pkg-config" is more likely to be packaged
under that name, so we can get away with "please install the pkg-config
package")

I'll look at this closer ("dpkg --purge --force-all pkg-config" is cute)
and commit something.

Thanks,

>  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
> 
> 

-- 
Could you people please use IRC like normal people?!?

  -- Amaya Rodrigo Sastre, trying to quiet down the buzz in the DebConf 2008
     Hacklab


Reply to: