[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] maint: be more robust to gnulib's FOO_H variables
From: |
Jim Meyering |
Subject: |
Re: [PATCH] maint: be more robust to gnulib's FOO_H variables |
Date: |
Fri, 20 Jan 2012 14:17:48 +0100 |
Akim Demaille wrote:
> With the current master, I have failures about sched.h, which
> should be lib/sched.h. We have too much dependency on the
> state of gnulib inside configure.ac. I propose the following
> simple change. It is optimistic (i.e., one can easily forge cases
> where it would break), but I'm not sure we need to be more
> cautious. A better alternative, of course, would be to have
> a means to have gnulib natively support such a package layout.
>
>
> From dcac080fea88d13cb714cf29556624a7717a7cac Mon Sep 17 00:00:00 2001
> From: Akim Demaille <address@hidden>
> Date: Fri, 20 Jan 2012 13:47:11 +0100
> Subject: [PATCH] maint: be more robust to gnulib's FOO_H variables.
>
> * configure.ac: Instead of listing gnulib's variables, look for
> them among AC_SUBST variables.
Nice. That is much more maintainable.
> configure.ac | 12 ++++++++----
> 1 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 78284e9..a99b45f 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -168,11 +168,15 @@ gt_JAVAEXEC
> # We use gnulib, but from lib/local.mk instead of lib/Makefile.am.
> # So prefix paths with lib/. See also etc/prefix-gnulib-mk.
> gl_LIBOBJS=`echo "$gl_LIBOBJS" | sed -e 's, , lib/,g'`
> -for ac_var in ALLOCA_H ERRNO_H FCNTL_H GETOPT_H INTTYPES_H \
> - LIBUNISTRING_UNITYPES_H LIBUNISTRING_UNIWIDTH_H \
> - STDBOOL_H STDINT_H SYS_WAIT_H WCHAR_H WCTYPE_H
> +# Listing the name of the variables to prefix is error-prone. Rather,
s/name/names/
> +# fetch all the AC_SUBST variables whose name ends in '_H', and whose
s/fetch/adjust/
> +# content ends in '.h'.
> +for ac_var in $ac_subst_vars
> do
> - eval "test x\$$ac_var = x || $ac_var=lib/\$$ac_var"
> + eval "ac_val=\$$ac_var"
> + case $ac_var=$ac_val in
> + (*_H=*.h) eval "$ac_var=lib/\$$ac_var";;
> + esac
> done
> AC_CONFIG_FILES([Makefile
> po/Makefile.in