Skip to content

Commit 29bff93

Browse files
committed
Enhance makedist script
This enhances the makidst script: - integrate both snapshot and makedist scripts together - add help and options - generated files are created in the php-src repository directly - other minor enhancemenets such as CS fixes - functionality moved from the Makefile to only shell script - Add missed patching of the Zend Parsers to the main build step - Add all *.tmp files to gitignore
1 parent 9690477 commit 29bff93

File tree

7 files changed

+180
-145
lines changed

7 files changed

+180
-145
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
# Swap files created by editors and tools to indicate a locked file
1717
*.swp
1818

19+
# Various temporary generated files
20+
*.tmp
21+
1922
# ------------------------------------------------------------------------------
2023
# Generated by the PHP build system
2124
# ------------------------------------------------------------------------------
@@ -225,7 +228,6 @@ php
225228

226229
# Generated by some test cases
227230
**/tests/**/*.db
228-
**/tests/**/*.tmp
229231

230232
# Microsoft Access database created for passing to tests
231233
/ext/pdo_odbc/tests/*.mdb

Zend/Makefile.frag

+13
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,20 @@ $(srcdir)/zend_language_scanner.c: $(srcdir)/zend_language_scanner.re
1010

1111
$(srcdir)/zend_language_parser.h: $(srcdir)/zend_language_parser.c
1212
$(srcdir)/zend_language_parser.c: $(srcdir)/zend_language_parser.y
13+
# Tweak zendparse to be exported through ZEND_API. This has to be revisited once
14+
# bison supports foreign skeletons and that bison version is used. Read
15+
# https://git.savannah.gnu.org/cgit/bison.git/tree/data/README.md for more.
1316
@$(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o $@
17+
@$(SED) -e 's,^int zendparse\(.*\),ZEND_API int zendparse\1,g' < $@ \
18+
19+
20+
@$(SED) -e 's,^int zendparse\(.*\),ZEND_API int zendparse\1,g' < $(srcdir)/zend_language_parser.h \
21+
> $(srcdir)/zend_language_parser.h.tmp && \
22+
mv $(srcdir)/zend_language_parser.h.tmp $(srcdir)/zend_language_parser.h
23+
@$(SED) -e 's,^#ifndef YYTOKENTYPE,#include "zend.h"\
24+
#ifndef YYTOKENTYPE,g' < $(srcdir)/zend_language_parser.h \
25+
> $(srcdir)/zend_language_parser.h.tmp && \
26+
mv $(srcdir)/zend_language_parser.h.tmp $(srcdir)/zend_language_parser.h
1427

1528
$(srcdir)/zend_ini_parser.h: $(srcdir)/zend_ini_parser.c
1629
$(srcdir)/zend_ini_parser.c: $(srcdir)/zend_ini_parser.y

build/build.mk

-26
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
# Makefile to generate build tools
1919
#
2020

21-
subdirs = Zend TSRM
2221
config_h_in = main/php_config.h.in
2322
PHP_AUTOCONF = autoconf
2423
PHP_AUTOHEADER = autoheader
@@ -41,28 +40,3 @@ $(config_h_in): configure
4140
@rm -f $@
4241
@$(PHP_AUTOHEADER) $(PHP_AUTOCONF_FLAGS)
4342
@sed -e 's/^#undef PACKAGE_[^ ]*/\/\* & \*\//g' < $@ > [email protected] && mv [email protected] $@
44-
45-
snapshot:
46-
distname='$(DISTNAME)'; \
47-
if test -z "$$distname"; then \
48-
distname='php7-snapshot'; \
49-
fi; \
50-
myname=`basename \`pwd\`` ; \
51-
cd .. && cp -rp $$myname $$distname; \
52-
cd $$distname; \
53-
rm -f $(subdirs) 2>/dev/null || true; \
54-
for i in $(subdirs); do \
55-
test -d $$i || (test -d ../$$i && cp -rp ../$$i $$i); \
56-
done; \
57-
find . -type l -exec rm {} \; ; \
58-
$(MAKE) -f build/build.mk; \
59-
cd ..; \
60-
tar cf $$distname.tar $$distname; \
61-
rm -rf $$distname $$distname.tar.*; \
62-
bzip2 -9 $$distname.tar; \
63-
md5sum $$distname.tar.bz2; \
64-
sync; sleep 2; \
65-
md5sum $$distname.tar.bz2; \
66-
bzip2 -t $$distname.tar.bz2
67-
68-
.PHONY: snapshot

docs/release-process.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
git push origin {release branch}
118118
```
119119
120-
12. Run: `PHPROOT=. ./scripts/dev/makedist 5.4.2RC2`, this will export the tree,
120+
12. Run: `./scripts/dev/makedist php-7.4.0RC2`, this will export the tree,
121121
create `configure` and build three tarballs (gz, bz2 and xz).
122122
123123
13. Run `scripts/dev/gen_verify_stub <version> [identity]`, this will sign the
@@ -213,11 +213,11 @@
213213
214214
6. Check `./sapi/cli/php -v` output for version matching.
215215
216-
7. Tag the repository with the version f.e. `git tag -u YOURKEYID php-5.4.1`
216+
7. Tag the repository with the version f.e. `git tag -u YOURKEYID php-7.4.1`
217217
218-
8. Push the tag f.e. `git push origin php-5.4.1`.
218+
8. Push the tag f.e. `git push origin php-7.4.1`.
219219
220-
9. Run: `PHPROOT=. ./scripts/dev/makedist 5.4.1`, this will export the tag,
220+
9. Run: `./scripts/dev/makedist php-7.4.1`, this will export the tag,
221221
create configure and build three tarballs (gz, bz2 and xz). Check if the
222222
pear files are updated (phar). On some systems the behavior of GNU tar can
223223
default to produce POSIX compliant archives with PAX headers. As not every

scripts/dev/genfiles

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ if ! test -x "$(command -v $MAKE)"; then
102102
fi
103103

104104
echo "genfiles: Generating Zend parser and lexer files"
105-
$MAKE RE2C="$RE2C" RE2C_FLAGS="$RE2C_FLAGS" YACC="$YACC" srcdir=Zend builddir=Zend top_srcdir=. \
105+
$MAKE RE2C="$RE2C" RE2C_FLAGS="$RE2C_FLAGS" YACC="$YACC" SED="$SED" srcdir=Zend builddir=Zend top_srcdir=. \
106106
-f Zend/Makefile.frag \
107107
Zend/zend_language_parser.c \
108108
Zend/zend_language_scanner.c \

0 commit comments

Comments
 (0)