[v2] timezone: add a configure flag to disable program install
Commit Message
Some distros build+install the timezone tools (zic/zdump/tzselect) outside
of glibc and use the upstream package directly. Add a configure flag to
glibc so they can disable install of those tools.
This allows tests to run & pass regardless of the configure flag. Only
the install of them is impacted.
2015-09-18 Mike Frysinger <vapier@gentoo.org>
* config.make.in (enable-timezone-tools): New variable.
* configure.ac (AC_ARG_ENABLE(timezone-tools)): New configure flag.
(enable_timezone_tools): Export to generated files.
* configure: Regenerate.
* INSTALL: Regenerate.
* manual/install.texi (--disable-timezone-tools): Document new flag.
* timezone/Makefile (install-sbin, install-bin-script): Wrap in a
ifeq ($(enable-timezone-tools),yes) check.
---
v2
- change from WITH to ENABLE
- update the install manual
INSTALL | 6 ++++++
config.make.in | 1 +
configure | 13 +++++++++++++
configure.ac | 6 ++++++
manual/install.texi | 6 ++++++
timezone/Makefile | 8 +++++---
6 files changed, 37 insertions(+), 3 deletions(-)
Comments
On 09/18/2015 11:46 AM, Mike Frysinger wrote:
> This allows tests to run & pass regardless of the configure flag.
Shouldn't distros with tzcode's zic normally want to do these test with
the distro-supplied zic rather than glibc's zic? Suppose glibc's zic
generates version-2 format and tzcode's zic generates version-3 format:
testers on such a distro will want to make sure that glibc can read
version-3-format tz files.
On 18 Sep 2015 12:09, Paul Eggert wrote:
> On 09/18/2015 11:46 AM, Mike Frysinger wrote:
> > This allows tests to run & pass regardless of the configure flag.
>
> Shouldn't distros with tzcode's zic normally want to do these test with
> the distro-supplied zic rather than glibc's zic? Suppose glibc's zic
> generates version-2 format and tzcode's zic generates version-3 format:
> testers on such a distro will want to make sure that glibc can read
> version-3-format tz files.
i'm not sure this is worth the effort. the current ifeq logic is minimal
and i don't think we want this to get more convoluted. in this particular
case, i'd rather mark it as caveat emptor.
-mike
On Fri, 18 Sep 2015, Mike Frysinger wrote:
> +@item --disable-timezone-tools
> +By default, timezone related utilities (zic, zdump, and tzselect) are
@command{zic}, @command{zdump}, @command{tzselect}.
On Fri, 18 Sep 2015, Paul Eggert wrote:
> On 09/18/2015 11:46 AM, Mike Frysinger wrote:
> > This allows tests to run & pass regardless of the configure flag.
>
> Shouldn't distros with tzcode's zic normally want to do these test with the
> distro-supplied zic rather than glibc's zic? Suppose glibc's zic generates
> version-2 format and tzcode's zic generates version-3 format: testers on such
> a distro will want to make sure that glibc can read version-3-format tz files.
I don't think such testing should depend on the distribution. Rather, we
should test that glibc works with both versions (bug 16334).
On 09/18/2015 12:34 PM, Mike Frysinger wrote:
> in this particular
> case, i'd rather mark it as caveat emptor.
OK, but please moneo emptori in the documentation for the new configure
flag. (Moneo emptori means to mention this issue to the 'configure'
user -- literally, "warn the buyer".)
@@ -127,6 +127,12 @@ will be used, and CFLAGS sets optimization options for the compiler.
library. This option hardcodes the newly built C library path in
dynamic tests so that they can be invoked directly.
+'--disable-timezone-tools'
+ By default, timezone related utilities (zic, zdump, and tzselect)
+ are installed with glibc. If you are building these independently
+ (e.g. by using the tzcode package), then this option will allow
+ disabling the install of these too.
+
'--enable-lock-elision=yes'
Enable lock elision for pthread mutexes by default.
@@ -52,6 +52,7 @@ have-z-execstack = @libc_cv_z_execstack@
have-Bgroup = @libc_cv_Bgroup@
have-protected-data = @libc_cv_protected_data@
with-fp = @with_fp@
+enable-timezone-tools = @enable_timezone_tools@
old-glibc-headers = @old_glibc_headers@
unwind-find-fde = @libc_cv_gcc_unwind_find_fde@
have-forced-unwind = @libc_cv_forced_unwind@
@@ -676,6 +676,7 @@ force_install
bindnow
enable_lock_elision
hardcoded_path_in_tests
+enable_timezone_tools
use_default_link
sysheaders
with_fp
@@ -759,6 +760,7 @@ with_default_link
enable_sanity_checks
enable_shared
enable_profile
+enable_timezone_tools
enable_hardcoded_path_in_tests
enable_stackguard_randomization
enable_lock_elision
@@ -1411,6 +1413,9 @@ Optional Features:
in special situations) [default=yes]
--enable-shared build shared library [default=yes if GNU ld]
--enable-profile build profiled library [default=no]
+ --disable-timezone-tools
+ do not install timezone tools (if using external
+ ones) [default=install]
--enable-hardcoded-path-in-tests
hardcode newly built glibc path in tests
[default=no]
@@ -3548,6 +3553,14 @@ else
profile=no
fi
+# Check whether --enable-timezone-tools was given.
+if test "${enable_timezone_tools+set}" = set; then :
+ enableval=$enable_timezone_tools; enable_timezone_tools=$enableval
+else
+ enable_timezone_tools=yes
+fi
+
+
# Check whether --enable-hardcoded-path-in-tests was given.
if test "${enable_hardcoded_path_in_tests+set}" = set; then :
@@ -159,6 +159,12 @@ AC_ARG_ENABLE([profile],
[build profiled library @<:@default=no@:>@]),
[profile=$enableval],
[profile=no])
+AC_ARG_ENABLE([timezone-tools],
+ AC_HELP_STRING([--disable-timezone-tools],
+ [do not install timezone tools (if using external ones) @<:@default=install@:>@]),
+ [enable_timezone_tools=$enableval],
+ [enable_timezone_tools=yes])
+AC_SUBST(enable_timezone_tools)
AC_ARG_ENABLE([hardcoded-path-in-tests],
AC_HELP_STRING([--enable-hardcoded-path-in-tests],
@@ -157,6 +157,12 @@ By default, dynamic tests are linked to run with the installed C library.
This option hardcodes the newly built C library path in dynamic tests
so that they can be invoked directly.
+@item --disable-timezone-tools
+By default, timezone related utilities (zic, zdump, and tzselect) are
+installed with glibc. If you are building these independently (e.g.
+by using the tzcode package), then this option will allow disabling
+the install of these too.
+
@item --enable-lock-elision=yes
Enable lock elision for pthread mutexes by default.
@@ -27,15 +27,17 @@ extra-objs := scheck.o ialloc.o
others := zdump zic
tests := test-tz tst-timezone tst-tzset
-install-sbin := zic zdump
-
generated-dirs += testdata
-install-bin-script = tzselect
generated += tzselect
testdata = $(objpfx)testdata
+ifeq ($(enable-timezone-tools),yes)
+install-sbin := zic zdump
+install-bin-script = tzselect
+endif
+
ifeq ($(run-built-tests),yes)
# List zones generated by separate commands running zic on the host.
# Each such zic run counts as a separate test.