From: Stefano Lattarini Date: Mon, 30 Jul 2012 07:40:05 +0000 (+0200) Subject: [ng] refactor: consider $(EXEEXT) used if non-empty at make runtime X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef7b8500dd4f93ed3411d06b45dcd4134e641bd0;p=thirdparty%2Fautomake.git [ng] refactor: consider $(EXEEXT) used if non-empty at make runtime To check whether we should handle $(EXEEXT), simply check for "ifdef EXEEXT" in our Makefile fragments, rather than also checking whether EXEEXT has been set as a configure-time AC_SUBST. This simplifies the logic, and move it completely at make runtime, rather than having it split between automake runtime (to decide whether EXEEXT is AC_SUBST) and make runtime (to decide whether $(EXEEXT) is empty). * lib/am/header-vars.am (EXEEXT): Default to empty. This is required to avoid environment interferences. (am.conf.handle-exeext): Define this no more. * lib/am/parallel-tests.am, lib/am/serial-tests.am: Simply look at $(EXEEXT), rather than using $(am.conf.handle-exeext), or the '%?HANDLE-EXEEXT%' transform. * automake.in (process_file): Don't define that transform anymore. Signed-off-by: Stefano Lattarini --- diff --git a/automake.in b/automake.in index 01df5fee1..3d09cc283 100644 --- a/automake.in +++ b/automake.in @@ -5799,8 +5799,6 @@ sub preprocess_file ($%) 'LIBTOOL' => !! var ('LIBTOOL'), 'NONLIBTOOL' => 1, - 'HANDLE-EXEEXT' => (exists $configure_vars{'EXEEXT'} ? - 'TRUE' : 'FALSE'), 'SILENT' => silent_flag (), %transform); diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am index fc3d3cf55..e86f5b3c3 100644 --- a/lib/am/header-vars.am +++ b/lib/am/header-vars.am @@ -102,6 +102,9 @@ endef ifeq ($(call am.vars.is-undef,SUBDIRS),yes) SUBDIRS := endif +ifeq ($(call am.vars.is-undef,EXEEXT),yes) + EXEEXT := +endif # CDPATH is only useful in interactive usage, and should never be exported # in the environment; doing so could cause our recipes and scripts to chdir @@ -180,9 +183,6 @@ am.util.uniq = $(strip \ $(am.chars.empty), \ $(lastword $(1))))) -?HANDLE-EXEEXT?am.conf.handle-exeext := yes -?!HANDLE-EXEEXT?am.conf.handle-exeext := no - ## These definitions have been generated by the following Bash 4 script: ## ## #!/bin/bash diff --git a/lib/am/parallel-tests.am b/lib/am/parallel-tests.am index 579ffe54a..3ad7de621 100644 --- a/lib/am/parallel-tests.am +++ b/lib/am/parallel-tests.am @@ -66,12 +66,10 @@ $(2)LOG_DRIVER = $(SHELL) $(am.conf.aux-dir)/test-driver endif %.log %.trs: %$1 $$($(2)LOG_DEPENDENCIES) @$$(call am.test-suite.runtest,$2) -ifeq ($(am.conf.handle-exeext),yes) ifdef EXEEXT %.log %.trs: %$1$(EXEEXT) $$($(2)LOG_DEPENDENCIES) @$$(call am.test-suite.runtest,$2) -endif # defined EXEEXT -endif # am.conf.handle-exeext = yes +endif endef define am.test-suite.handle-suffix @@ -103,10 +101,11 @@ $(eval $(call am.test-suite.handle-suffix)) # TESTS = $(wildcard $(srcdir)/t[0-9][0-9]*.sh) # where removing the $(srcdir) from the $(wildcard) invocation would # cause the idiom to break in VPATH builds. -am.test-suite.get-test-bases = $(patsubst $(srcdir)/%,%,$(strip \ -$(call am.util.strip-suffixes, $(TEST_EXTENSIONS), \ -?!HANDLE-EXEEXT? $(1)))) -?HANDLE-EXEEXT? $(patsubst %$(EXEEXT),%,$(1))))) +define am.test-suite.get-test-bases +$(patsubst $(srcdir)/%,%,$(strip \ + $(call am.util.strip-suffixes, $(TEST_EXTENSIONS), \ + $(if $(EXEEXT),$(patsubst %$(EXEEXT),%,$1),$1)))) +endef am.test-suite.rx.recheck = ^[ ]*:recheck:[ ]* am.test-suite.rx.global-result = ^[ ]*:global-test-result:[ ]* diff --git a/lib/am/serial-tests.am b/lib/am/serial-tests.am index 0c31e2649..7781fdaaa 100644 --- a/lib/am/serial-tests.am +++ b/lib/am/serial-tests.am @@ -16,12 +16,12 @@ ## Obsolescent serial testsuite driver. -ifeq ($(am.conf.handle-exeext),yes) +ifdef EXEEXT ## This is suboptimal, but we need to preserve the order of $(TESTS). am__check_cook_with_exeext_1 = \ $(if $(filter $(am.all-progs), $1), $1$(EXEEXT), $1) -am__check_cook_with_exeext = $(strip \ - $(if $(EXEEXT), $(foreach t, $1, $(call $(0)_1, $t)), $1)) +am__check_cook_with_exeext = \ + $(strip $(foreach t, $1, $(call $(0)_1, $t))) else am__check_cook_with_exeext = $(strip $1) endif