Skip to content

Commit 02c1f32

Browse files
committed
Join build makefiles together
Changes: - Joins build/build.mk and build/build2.mk files together since there isn't any practical reason for having two different files with the current build system. - Makefile is now more portable. All special syntaxes are omitted, for example, a conditional assignment operators `?=`. This makes buildconf more useful on Solaris make derivative, so there is no longer need to override make with gmake: `MAKE=gmake ./buildconf`. - Suppressing autoconf and autoheader warnings is not needed anymore with current build system. Instead, the option `-Wall` has been used when running `./buildconf --debug` to get more useful debug info about current M4.
1 parent 663056a commit 02c1f32

File tree

3 files changed

+38
-57
lines changed

3 files changed

+38
-57
lines changed

build/build.mk

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,35 @@
1818
# Makefile to generate build tools
1919
#
2020

21-
SUBDIRS = Zend TSRM
21+
subdirs = Zend TSRM
22+
stamp = buildmk.stamp
23+
config_h_in = main/php_config.h.in
24+
PHP_AUTOCONF = autoconf
25+
PHP_AUTOHEADER = autoheader
26+
PHP_AUTOCONF_FLAGS = -f
2227

23-
STAMP = buildmk.stamp
28+
all: $(stamp) configure $(config_h_in)
2429

25-
all: $(STAMP)
26-
@$(MAKE) -s -f build/build2.mk
30+
$(stamp): build/buildcheck.sh
31+
@build/buildcheck.sh $@
2732

28-
$(STAMP): build/buildcheck.sh
29-
@build/buildcheck.sh $(STAMP)
33+
configure: aclocal.m4 configure.ac $(PHP_M4_FILES)
34+
@echo rebuilding $@
35+
@rm -f $@
36+
@$(PHP_AUTOCONF) $(PHP_AUTOCONF_FLAGS)
37+
38+
aclocal.m4: configure.ac acinclude.m4
39+
@echo rebuilding $@
40+
@cat acinclude.m4 ./build/libtool.m4 > $@
41+
42+
$(config_h_in): configure
43+
# Explicitly remove target since autoheader does not seem to work correctly
44+
# otherwise (timestamps are not updated). Also disable PACKAGE_* symbols in the
45+
# generated php_config.h.in template.
46+
@echo rebuilding $@
47+
@rm -f $@
48+
@$(PHP_AUTOHEADER) $(PHP_AUTOCONF_FLAGS)
49+
@sed -e 's/^#undef PACKAGE_[^ ]*/\/\* & \*\//g' < $@ > $@.tmp && mv $@.tmp $@
3050

3151
snapshot:
3252
distname='$(DISTNAME)'; \
@@ -36,8 +56,8 @@ snapshot:
3656
myname=`basename \`pwd\`` ; \
3757
cd .. && cp -rp $$myname $$distname; \
3858
cd $$distname; \
39-
rm -f $(SUBDIRS) 2>/dev/null || true; \
40-
for i in $(SUBDIRS); do \
59+
rm -f $(subdirs) 2>/dev/null || true; \
60+
for i in $(subdirs); do \
4161
test -d $$i || (test -d ../$$i && cp -rp ../$$i $$i); \
4262
done; \
4363
find . -type l -exec rm {} \; ; \

build/build2.mk

Lines changed: 0 additions & 44 deletions
This file was deleted.

buildconf

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# A wrapper around Autoconf that generates files to build PHP on *nix systems.
44

55
MAKE=${MAKE:-make}
6+
PHP_AUTOCONF=${PHP_AUTOCONF:-autoconf}
7+
PHP_AUTOHEADER=${PHP_AUTOHEADER:-autoheader}
68
force=0
79
debug=0
810

@@ -91,11 +93,14 @@ fi
9193

9294
echo "buildconf: Building configure files"
9395

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)
96-
9796
if test "$debug" = "1"; then
98-
$MAKE -s -f build/build.mk M4_FILES="$M4_FILES" SUPPRESS_WARNINGS=""
97+
autoconf_flags="-f -Wall"
9998
else
100-
$MAKE -s -f build/build.mk M4_FILES="$M4_FILES"
99+
autoconf_flags="-f"
101100
fi
101+
102+
$MAKE -s -f build/build.mk \
103+
PHP_AUTOCONF="$PHP_AUTOCONF" \
104+
PHP_AUTOHEADER="$PHP_AUTOHEADER" \
105+
PHP_AUTOCONF_FLAGS="$autoconf_flags" \
106+
PHP_M4_FILES="$(echo TSRM/*.m4 Zend/*.m4 ext/*/config*.m4 sapi/*/config*.m4)"

0 commit comments

Comments
 (0)