diff mbox

[v4] timezone: add a configure flag to disable program install

Message ID 1442612997-31368-1-git-send-email-vapier@gentoo.org
State Committed
Delegated to: Mike Frysinger
Headers show

Commit Message

Mike Frysinger Sept. 18, 2015, 9:49 p.m. UTC
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.
---
v4
	- more manual word smithing & style tweaks

 INSTALL             | 11 +++++++++++
 config.make.in      |  1 +
 configure           | 13 +++++++++++++
 configure.ac        |  6 ++++++
 manual/install.texi | 10 ++++++++++
 timezone/Makefile   |  8 +++++---
 6 files changed, 46 insertions(+), 3 deletions(-)

Comments

Roland McGrath Sept. 18, 2015, 9:55 p.m. UTC | #1
This version looks fine to me.
Paul Eggert Sept. 18, 2015, 11:11 p.m. UTC | #2
Thanks, looks good to me too.
Rical Jasan Sept. 21, 2015, 4:31 a.m. UTC | #3
Probably late on this, being a casual digestor of libc-alpha, but here
are my two cents:

On 09/18/2015 02:49 PM, Mike Frysinger wrote:
> 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.

I know it's acceptably colloquial, but: s/install/&ation/


> diff --git a/INSTALL b/INSTALL

> +'--disable-timezone-tools'
> +     By default, timezone related utilities ('zic', 'zdump', and

I would write "timezone-related".

> +     'tzselect') are installed with glibc.  If you are building these
> +     independently (e.g.  by using the 'tzcode' package), then this

Put a comma after "e.g.", as it's a prepositional phrase.  Also, there
are two spaces after the period, where there should only be one.

> +     option will allow disabling the install of these too.

s/install/&ation/ (suggested)

Drop the "too".  In the context of this option's description, nothing
else has yet been referenced as having its installation disabled.

Actually, I would probably rewrite the then-clause like, "...will
disable their installation."

> +     Note that you need to make sure the external tools are kept in sync
> +     with the versions that the GNU C Library expects as the data
> +     formats may change over time.  Consult the 'timezone' subdirectory
> +     for more details.

I would drop "that" after "versions".

s/expects/&,/


> diff --git a/configure b/configure

> +  --disable-timezone-tools
> +                          do not install timezone tools (if using external
> +                          ones) [default=install]

I don't think the parenthetical statement is necessary, and is a little
misleading.  The option's behaviour does not depend on the use of
external timezone tools (i.e., it doesn't check whether external tools
are used).  Not that the statement isn't correct or helpful, but it can
be read both ways, so I'd prefer less ambiguity.  Just saying the
timezone tools won't be installed is both sufficient and reassuring in
its definitiveness.


> diff --git a/configure.ac b/configure.ac

> +			     [do not install timezone tools (if using external ones) @<:@default=install@:>@]),

Likewise.


> diff --git a/manual/install.texi b/manual/install.texi

> +By default, timezone related utilities (@command{zic}, @command{zdump},

"timezone-related" (suggested)

> +and @command{tzselect}) are installed with glibc.  If you are building

@theglibc{}

> +these independently (e.g. by using the @samp{tzcode} package), then this

Comma after "e.g.".

> +option will allow disabling the install of these too.

s/install/&ation/ (suggested)

Drop "too".

(alt: "...will disable their installation.")

> +Note that you need to make sure the external tools are kept in sync with
> +the versions that @theglibc{} expects as the data formats may change over

Drop "that" after "versions". (suggested)

s/expects/&,/


Rical Jasan
Joseph Myers Oct. 15, 2015, 12:02 p.m. UTC | #4
I think a new configure option like this should have a NEWS entry.  In 
general, people making changes should consider if they go beyond routine 
bug fixes and cleanups, and add NEWS entries if appropriate - such as for 
new functions, new configure options, new options to installed programs, 
new optimized function versions, new ports, withdrawn APIs.  (The release 
manager *also* needs to check for such changes during the freeze to catch 
cases the contributors missed at the time - item 6.3 at 
<https://sourceware.org/glibc/wiki/Release>.)
diff mbox

Patch

diff --git a/INSTALL b/INSTALL
index d55de5d..ca847e2 100644
--- a/INSTALL
+++ b/INSTALL
@@ -127,6 +127,17 @@  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.
+
+     Note that you need to make sure the external tools are kept in sync
+     with the versions that the GNU C Library expects as the data
+     formats may change over time.  Consult the 'timezone' subdirectory
+     for more details.
+
 '--enable-lock-elision=yes'
      Enable lock elision for pthread mutexes by default.
 
diff --git a/config.make.in b/config.make.in
index a9f5696..bea371d 100644
--- a/config.make.in
+++ b/config.make.in
@@ -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@
diff --git a/configure b/configure
index 45cc7cb..fe402ea 100755
--- a/configure
+++ b/configure
@@ -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 :
diff --git a/configure.ac b/configure.ac
index 7e9383a..95d700e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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],
diff --git a/manual/install.texi b/manual/install.texi
index 63c41b0..c502446 100644
--- a/manual/install.texi
+++ b/manual/install.texi
@@ -157,6 +157,16 @@  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 (@command{zic}, @command{zdump},
+and @command{tzselect}) are installed with glibc.  If you are building
+these independently (e.g. by using the @samp{tzcode} package), then this
+option will allow disabling the install of these too.
+
+Note that you need to make sure the external tools are kept in sync with
+the versions that @theglibc{} expects as the data formats may change over
+time.  Consult the @file{timezone} subdirectory for more details.
+
 @item --enable-lock-elision=yes
 Enable lock elision for pthread mutexes by default.
 
diff --git a/timezone/Makefile b/timezone/Makefile
index bfb3463..a0b8adb 100644
--- a/timezone/Makefile
+++ b/timezone/Makefile
@@ -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.