[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gettext] Suggestion: improve handling of cond. subdirs
From: |
Bruno Haible |
Subject: |
Re: [gettext] Suggestion: improve handling of cond. subdirs |
Date: |
Wed, 10 Aug 2005 13:33:25 +0200 |
User-agent: |
KMail/1.5 |
Stepan Kasal wrote:
> OTOH, the fact that the same thing is declared twice decreases
> maintainablity.
>
> I think the following is better than my original proposal:
>
> if LIBASPRINTF
> SUBDIRS_libasprintf = libasprintf
> endif
> if GLOCALE
> SUBDIRS_glocale = glocale
> endif
> SUBDIRS = doc intl intl-java intl-csharp lib \
> $(SUBDIR_libasprintf) $(SUBDIR_glocale) \
> src po man m4 tests
>
> I think thart this usage of 'if' can be interpreted as a conditional
> expression (the "else SUBDIRS_libasprintf =" is ommitted), so it is
> declarative.
> I like the fact that DIST_SUBDIRS need not be defined manually.
Thanks for the suggestion. Indeed this is declarative, and it's a documented
feature of automake that DIST_SUBDIRS gets calculated correctly in this case.
I've applied this patch.
Bruno
2005-08-10 Bruno Haible <address@hidden>
* configure.ac (SUBDIR_libasprintf, SUBDIR_glocale): Remove AC_SUBSTs.
(ENABLE_LIBASPRINTF, ENABLE_GLOCALE): New automake conditionals.
* Makefile.am (SUBDIR_libasprintf, SUBDIR_glocale): New variables.
(SUBDIRS): Use them.
(DIST_SUBDIRS): Remove variable. Automake computes it correctly through
the conditionals.
Suggested by Stepan Kasal <address@hidden>.
diff -c -3 -r1.28 configure.ac
*** gettext-runtime/configure.ac 3 Aug 2005 11:20:41 -0000 1.28
--- gettext-runtime/configure.ac 10 Aug 2005 11:30:26 -0000
***************
*** 147,153 ****
if test "$CXX" = ":"; then
SUBDIR_libasprintf=
fi
! AC_SUBST(SUBDIR_libasprintf)
dnl Determine whether to build glocale.
AC_ARG_ENABLE(libglocale,
--- 147,153 ----
if test "$CXX" = ":"; then
SUBDIR_libasprintf=
fi
! AM_CONDITIONAL([ENABLE_LIBASPRINTF], [test -n "$SUBDIR_libasprintf"])
dnl Determine whether to build glocale.
AC_ARG_ENABLE(libglocale,
***************
*** 158,164 ****
SUBDIR_glocale=
fi
], SUBDIR_glocale=glocale)
! AC_SUBST(SUBDIR_glocale)
AC_CONFIG_SUBDIRS(libasprintf glocale)
--- 158,164 ----
SUBDIR_glocale=
fi
], SUBDIR_glocale=glocale)
! AM_CONDITIONAL([ENABLE_GLOCALE], [test -n "$SUBDIR_glocale"])
AC_CONFIG_SUBDIRS(libasprintf glocale)
diff -c -3 -r1.27 Makefile.am
*** gettext-runtime/Makefile.am 3 Aug 2005 11:20:41 -0000 1.27
--- gettext-runtime/Makefile.am 10 Aug 2005 11:30:26 -0000
***************
*** 22,29 ****
MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@
! SUBDIRS = doc intl intl-java intl-csharp lib @SUBDIR_libasprintf@
@SUBDIR_glocale@ src po man m4 tests
! DIST_SUBDIRS = doc intl intl-java intl-csharp lib libasprintf
glocale src po man m4 tests
EXTRA_DIST = BUGS
--- 22,40 ----
MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@
! # The list of subdirectories depends on whether --disable-libasprintf or
! # --disable-glocale was specified.
! if ENABLE_LIBASPRINTF
! SUBDIR_libasprintf = libasprintf
! else
! SUBDIR_libasprintf =
! endif
! if ENABLE_GLOCALE
! SUBDIR_glocale = glocale
! else
! SUBDIR_glocale =
! endif
! SUBDIRS = doc intl intl-java intl-csharp lib $(SUBDIR_libasprintf)
$(SUBDIR_glocale) src po man m4 tests
EXTRA_DIST = BUGS