Bug #78102 [Com]: Can't compile on OSX
| From: | petk@php.net | Date: | Tue, 04 Jun 2019 15:21:36 +0000 |
| Subject: | Bug #78102 [Com]: Can't compile on OSX | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-221112@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78102&edit=1
ID: 78102
Comment by: petk@php.net
Reported by: dams@php.net
Summary: Can't compile on OSX
Status: Open
Type: Bug
Package: Compile Failure
Operating System: OSX
PHP Version: Next Major Version
Block user comment: N
Private report: N
New Comment:
Yes, confirmed. It's the special version and build of Make for macOS 3.81 that causes this. Has
been identified via appended patch above.
Until this patch is confirmed and merged in the php-src we can now also bypass this using the usual
GNU Make:
brew install make
and adding this on the first line of the ~/.bashrc file (or ~/.zshrc and equivalent):
PATH="/usr/local/opt/make/libexec/gnubin:$PATH"
That will give you something like this:
make -v
GNU Make 4.2.1
Built for x86_64-apple-darwin18.2.0
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Which is equivalent to:
gmake -v
macOS is not catching up with some tools versions out there (such as this strange make 3.81
prehistoric version released in 2006) due to their licensing lockups and annoyances.
Previous Comments:
------------------------------------------------------------------------
[2019-06-04 05:49:45] dams@php.net
>make -v
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
I also upgrade to the latest command line tools (from yesterday), and I keep running into the same
version and error.
------------------------------------------------------------------------
[2019-06-03 22:35:51] petk@php.net
The following patch has been added/updated:
Patch Name: 78102.patch
Revision: 1559601351
URL: https://bugs.php.net/patch-display.php?bug=78102&patch=78102.patch&revision=1559601351
------------------------------------------------------------------------
[2019-06-03 20:32:29] petk@php.net
Hello. Thanks for the report. It's the macOS version of make most likely here...
What is the output of this on this machine?
make -v
------------------------------------------------------------------------
[2019-06-03 20:10:09] dams@php.net
Description:
------------
I'm building PHP 7.4 from the git repository : fresh clone, and short compilation script (see
below).
I've been bumping the following error message for 3 weeks now :
/Users/php/bin/php-src/Zend/zend_language_parser.h:205:2: error: #endif without #if
#endif /* !YY_ZEND_USERS_php_BIN_PHP_SRC_ZEND_ZEND_LANGUAGE_PARSER_H_INCLUDED */
I tried to disable all extensions, buildconf --force, make clean, script/dev/genfiles without
success. I also tried to build right after a clone.
PHP 7.3.6 builds (simple checkout), but 7.4 can't pass make.
I'm using bison 3.4.1, OSX Mojave
Test script:
---------------
git checkout PHP-7.4; git pull
make clean
./buildconf --force
env YACC=
brew --prefix bison/bin/bison ./configure \
--disable-all
make -jsysctl -n hw.logicalcpu_max
make test
Expected result:
----------------
Compilation succeed :)
Actual result:
--------------
In file included from /Users/php/bin/php-src/Zend/zend_ast.c:23:
/Users/php/bin/php-src/Zend/zend_language_parser.h:53:18: warning: extra tokens at end of #include
directive [-Wextra-tokens]
#include "zend.h"#ifndef YYTOKENTYPE
^
//
/Users/php/bin/php-src/Zend/zend_language_parser.h:205:2: error: #endif without #if
#endif /* !YY_ZEND_USERS_php_BIN_PHP_SRC_ZEND_ZEND_LANGUAGE_PARSER_H_INCLUDED */
^
1 warning and 1 error generated.
make: *** [Zend/zend_ast.lo] Error 1
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78102&edit=1