Skip to content

Commit b09fa9e

Browse files
committed
Simplify generated_lists generation
The `generated_lists` file is generated as a helper for build related Makefile to include a list of *.m4 files prerequisites. When some of these *.m4 files change, the configure script is regenerated when buildconf is run. This can be simplified using dynamic environment variable passed to the Makefile directly so it avoids another file from being generated in the project root directory and shipping it with the PHP release or creating a dedicated gitignore rule. This is portable across all POSIX compatible makes So this patch includes GNU Make, and everybody elses' make derivative support.
1 parent 12ee246 commit b09fa9e

File tree

4 files changed

+7
-18
lines changed

4 files changed

+7
-18
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ configure
6666
confdefs.h
6767
conftest*
6868

69-
# Generated by `./buildconf` script as a helper for further build/build2.mk file
70-
/generated_lists
71-
7269
# Generated by configure scripts on all systems
7370
/main/internal_functions.c
7471
/main/internal_functions_cli.c

build/build.mk

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,9 @@ SUBDIRS = Zend TSRM
2222

2323
STAMP = buildmk.stamp
2424

25-
ALWAYS = generated_lists
26-
27-
28-
all: $(STAMP) $(ALWAYS)
25+
all: $(STAMP)
2926
@$(MAKE) -s -f build/build2.mk
3027

31-
generated_lists:
32-
@echo config_m4_files = Zend/Zend.m4 TSRM/tsrm.m4 TSRM/threads.m4 \
33-
Zend/acinclude.m4 ext/*/config*.m4 sapi/*/config.m4 >> $@
34-
3528
$(STAMP): build/buildcheck.sh
3629
@build/buildcheck.sh $(STAMP)
3730

@@ -64,4 +57,4 @@ gitclean-work:
6457
fi; \
6558
git clean -X -f -d;
6659

67-
.PHONY: $(ALWAYS) snapshot
60+
.PHONY: snapshot

build/build2.mk

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
# | Author: Sascha Schumann <sascha@schumann.cx> |
1515
# +----------------------------------------------------------------------+
1616

17-
include generated_lists
18-
1917
config_h_in = main/php_config.h.in
2018

2119
targets = configure $(config_h_in)
@@ -40,7 +38,7 @@ aclocal.m4: configure.ac acinclude.m4
4038
@echo rebuilding $@
4139
cat acinclude.m4 ./build/libtool.m4 > $@
4240

43-
configure: aclocal.m4 configure.ac $(config_m4_files)
41+
configure: aclocal.m4 configure.ac $(M4_FILES)
4442
@echo rebuilding $@
4543
@rm -f $@
4644
$(PHP_AUTOCONF) -f $(SUPPRESS_WARNINGS)

buildconf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,11 @@ fi
9191

9292
echo "buildconf: Building configure files"
9393

94-
rm -f generated_lists
94+
# List of *.m4 prerequisites files for the make configure target.
95+
M4_FILES=$(echo TSRM/*.m4 Zend/*.m4 ext/*/config*.m4 sapi/*/config*.m4)
9596

9697
if test "$debug" = "1"; then
97-
$MAKE -s -f build/build.mk SUPPRESS_WARNINGS=""
98+
$MAKE -s -f build/build.mk M4_FILES="$M4_FILES" SUPPRESS_WARNINGS=""
9899
else
99-
$MAKE -s -f build/build.mk
100+
$MAKE -s -f build/build.mk M4_FILES="$M4_FILES"
100101
fi

0 commit comments

Comments
 (0)