Skip to content

Commit

Permalink
Enhance makedist script
Browse files Browse the repository at this point in the history
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
  • Loading branch information
petk committed May 18, 2019
1 parent 9690477 commit 29bff93
Show file tree
Hide file tree
Showing 7 changed files with 180 additions and 145 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Expand Up @@ -16,6 +16,9 @@
# Swap files created by editors and tools to indicate a locked file
*.swp

# Various temporary generated files
*.tmp

# ------------------------------------------------------------------------------
# Generated by the PHP build system
# ------------------------------------------------------------------------------
Expand Down Expand Up @@ -225,7 +228,6 @@ php

# Generated by some test cases
**/tests/**/*.db
**/tests/**/*.tmp

# Microsoft Access database created for passing to tests
/ext/pdo_odbc/tests/*.mdb
Expand Down
13 changes: 13 additions & 0 deletions Zend/Makefile.frag
Expand Up @@ -10,7 +10,20 @@ $(srcdir)/zend_language_scanner.c: $(srcdir)/zend_language_scanner.re

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

$(srcdir)/zend_ini_parser.h: $(srcdir)/zend_ini_parser.c
$(srcdir)/zend_ini_parser.c: $(srcdir)/zend_ini_parser.y
Expand Down
26 changes: 0 additions & 26 deletions build/build.mk
Expand Up @@ -18,7 +18,6 @@
# Makefile to generate build tools
#

subdirs = Zend TSRM
config_h_in = main/php_config.h.in
PHP_AUTOCONF = autoconf
PHP_AUTOHEADER = autoheader
Expand All @@ -41,28 +40,3 @@ $(config_h_in): configure
@rm -f $@
@$(PHP_AUTOHEADER) $(PHP_AUTOCONF_FLAGS)
@sed -e 's/^#undef PACKAGE_[^ ]*/\/\* & \*\//g' < $@ > $@.tmp && mv $@.tmp $@

snapshot:
distname='$(DISTNAME)'; \
if test -z "$$distname"; then \
distname='php7-snapshot'; \
fi; \
myname=`basename \`pwd\`` ; \
cd .. && cp -rp $$myname $$distname; \
cd $$distname; \
rm -f $(subdirs) 2>/dev/null || true; \
for i in $(subdirs); do \
test -d $$i || (test -d ../$$i && cp -rp ../$$i $$i); \
done; \
find . -type l -exec rm {} \; ; \
$(MAKE) -f build/build.mk; \
cd ..; \
tar cf $$distname.tar $$distname; \
rm -rf $$distname $$distname.tar.*; \
bzip2 -9 $$distname.tar; \
md5sum $$distname.tar.bz2; \
sync; sleep 2; \
md5sum $$distname.tar.bz2; \
bzip2 -t $$distname.tar.bz2

.PHONY: snapshot
8 changes: 4 additions & 4 deletions docs/release-process.md
Expand Up @@ -117,7 +117,7 @@
git push origin {release branch}
```

12. Run: `PHPROOT=. ./scripts/dev/makedist 5.4.2RC2`, this will export the tree,
12. Run: `./scripts/dev/makedist php-7.4.0RC2`, this will export the tree,
create `configure` and build three tarballs (gz, bz2 and xz).

13. Run `scripts/dev/gen_verify_stub <version> [identity]`, this will sign the
Expand Down Expand Up @@ -213,11 +213,11 @@

6. Check `./sapi/cli/php -v` output for version matching.

7. Tag the repository with the version f.e. `git tag -u YOURKEYID php-5.4.1`
7. Tag the repository with the version f.e. `git tag -u YOURKEYID php-7.4.1`

8. Push the tag f.e. `git push origin php-5.4.1`.
8. Push the tag f.e. `git push origin php-7.4.1`.

9. Run: `PHPROOT=. ./scripts/dev/makedist 5.4.1`, this will export the tag,
9. Run: `./scripts/dev/makedist php-7.4.1`, this will export the tag,
create configure and build three tarballs (gz, bz2 and xz). Check if the
pear files are updated (phar). On some systems the behavior of GNU tar can
default to produce POSIX compliant archives with PAX headers. As not every
Expand Down
2 changes: 1 addition & 1 deletion scripts/dev/genfiles
Expand Up @@ -102,7 +102,7 @@ if ! test -x "$(command -v $MAKE)"; then
fi

echo "genfiles: Generating Zend parser and lexer files"
$MAKE RE2C="$RE2C" RE2C_FLAGS="$RE2C_FLAGS" YACC="$YACC" srcdir=Zend builddir=Zend top_srcdir=. \
$MAKE RE2C="$RE2C" RE2C_FLAGS="$RE2C_FLAGS" YACC="$YACC" SED="$SED" srcdir=Zend builddir=Zend top_srcdir=. \
-f Zend/Makefile.frag \
Zend/zend_language_parser.c \
Zend/zend_language_scanner.c \
Expand Down

0 comments on commit 29bff93

Please sign in to comment.