]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - timezone/Makefile
Make time zone file parser more robust [BZ #17715]
[thirdparty/glibc.git] / timezone / Makefile
index d10c3a511e976b3e3c6b4c20d92f91015ffa13af..5f185458bce92e2be970f2199676d7429c5c8cc6 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2014 Free Software Foundation, Inc.
+# Copyright (C) 1998-2015 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -25,7 +25,7 @@ include ../Makeconfig
 extra-objs := scheck.o ialloc.o
 
 others := zdump zic
-tests  := test-tz tst-timezone
+tests  := test-tz tst-timezone tst-tzset
 
 # pacificnew doesn't compile; if it is to be used, it should be included in
 # northamerica.
@@ -40,18 +40,18 @@ install-sbin := zic zdump
 
 generated-dirs += testdata
 
-CPPFLAGS-zic = -DNOT_IN_libc
-
 install-bin-script = tzselect
 generated += tzselect
 
 testdata = $(objpfx)testdata
 
+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.
 test-zones := America/New_York Etc/UTC UTC Europe/Berlin \
              Australia/Melbourne America/Sao_Paulo Asia/Tokyo
 tests-special += $(addprefix $(testdata)/, $(test-zones))
+endif
 
 include ../Rules
 
@@ -80,8 +80,7 @@ CFLAGS-scheck.c = -Wno-strict-prototypes -DNOID -DHAVE_GETTEXT
 # Don't add leapseconds here since test-tz made checks that work only without
 # leapseconds.
 define build-testdata
-$(built-program-cmd-before-env) $(run-program-env) LANGUAGE=C \
-  $(built-program-cmd-after-env) -d $(testdata) -y ./yearistype $<; \
+$(built-program-cmd) -d $(testdata) -y ./yearistype $<; \
 $(evaluate-test)
 endef
 
@@ -91,9 +90,11 @@ $(objpfx)tst-timezone.out: $(addprefix $(testdata)/, \
                                       Australia/Melbourne \
                                       America/Sao_Paulo Asia/Tokyo \
                                       Europe/London)
+$(objpfx)tst-tzset.out: $(addprefix $(testdata)/XT, 1 2 3 4)
 
 test-tz-ENV = TZDIR=$(testdata)
 tst-timezone-ENV = TZDIR=$(testdata)
+tst-tzset-ENV = TZDIR=$(testdata)
 
 # Note this must come second in the deps list for $(built-program-cmd) to work.
 zic-deps = $(objpfx)zic $(leapseconds) yearistype
@@ -115,6 +116,8 @@ $(testdata)/America/Sao_Paulo: southamerica $(zic-deps)
 $(testdata)/Asia/Tokyo: asia $(zic-deps)
        $(build-testdata)
 
+$(testdata)/XT%: testdata/XT%
+       cp $< $@
 
 $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
        sed -e 's|/bin/bash|$(BASH)|' \