我试图用Xcode 8.2.1从the official php-src/PHP-7.1.0
branch on github构建一个完全干净的PHP 7.1 OS X 10.11.6,但我得到这个错误:无法在Mac OS X上构建PHP 7.1 - 错误:使用不同类型的typedef重定义('long'vs'long long')
make distclean
./configure
...
gawk: fatal: cannot open file `date/*.h*' for reading (No such file or directory)
...
make BR php-7.1
/bin/sh /Users/myusername/Sites/php-src/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/date/lib -Iext/date/ -I/Users/myusername/Sites/php-src/ext/date/ -DPHP_ATOM_INC -I/Users/myusername/Sites/php-src/include -I/Users/myusername/Sites/php-src/main -I/Users/myusername/Sites/php-src -I/Users/myusername/Sites/php-src/ext/date/lib -I/Users/myusername/Sites/php-src/ext/ereg/regex -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2 -I/Users/myusername/Sites/php-src/ext/sqlite3/libsqlite -I/Users/myusername/Sites/php-src/TSRM -I/Users/myusername/Sites/php-src/Zend -no-cpp-precomp -I/usr/include -g -O2 -fvisibility=hidden -c /Users/myusername/Sites/php-src/ext/date/php_date.c -o ext/date/php_date.lo
In file included from /Users/myusername/Sites/php-src/ext/date/php_date.c:21:
In file included from /Users/myusername/Sites/php-src/main/php.h:35:
In file included from /Users/myusername/Sites/php-src/Zend/zend.h:31:
In file included from /Users/myusername/Sites/php-src/Zend/zend_types.h:27:
In file included from /Users/myusername/Sites/php-src/Zend/zend_portability.h:52:
In file included from /Users/myusername/Sites/php-src/Zend/../TSRM/TSRM.h:23:
/Users/myusername/Sites/php-src/main/php_stdint.h:172:14: error: typedef redefinition with different types ('long' vs 'long long')
typedef long int64_t;
^
/usr/include/sys/_types/_int64_t.h:30:20: note: previous definition is here
typedef long long int64_t;
^
In file included from /Users/myusername/Sites/php-src/ext/date/php_date.c:21:
In file included from /Users/myusername/Sites/php-src/main/php.h:35:
In file included from /Users/myusername/Sites/php-src/Zend/zend.h:31:
In file included from /Users/myusername/Sites/php-src/Zend/zend_types.h:27:
In file included from /Users/myusername/Sites/php-src/Zend/zend_portability.h:52:
In file included from /Users/myusername/Sites/php-src/Zend/../TSRM/TSRM.h:23:
/Users/myusername/Sites/php-src/main/php_stdint.h:198:23: error: typedef redefinition with different types ('unsigned long' vs 'unsigned long long')
typedef unsigned long uint64_t;
^
/usr/include/_types/_uint64_t.h:31:28: note: previous definition is here
typedef unsigned long long uint64_t;
^
用于配置中失踪的日期头不好看,但我不清楚这是否是一个本地配置的问题或PHP源问题。有任何想法吗?
更新更进一步的l'L'l的建议,我有一个在其他方面的建设去。然而,从tarball作品构建,我更愿意从git构建,因为我希望能够将PR提交回php-src,并且如果我这样做,一切都将正确跟踪。 git构建步骤不是很高兴:
./genfiles
Zend/zend_language_parser.y:49.1-5: invalid directive: '%code'
Zend/zend_language_parser.y:49.7-14: syntax error, unexpected identifier
make: *** [Zend/zend_language_parser.c] Error 1
+ CLEANUP_FILES=' ext/pdo/pdo_sql_parser.c ext/date/lib/parse_date.c ext/standard/url_scanner_ex.c ext/standard/var_unserializer.c '
+ for f in '$CLEANUP_FILES'
+ cp ext/pdo/pdo_sql_parser.c ext/pdo/pdo_sql_parser.c.orig
+ grep -v '#line ' ext/pdo/pdo_sql_parser.c.orig
+ for f in '$CLEANUP_FILES'
+ cp ext/date/lib/parse_date.c ext/date/lib/parse_date.c.orig
+ grep -v '#line ' ext/date/lib/parse_date.c.orig
+ for f in '$CLEANUP_FILES'
+ cp ext/standard/url_scanner_ex.c ext/standard/url_scanner_ex.c.orig
+ grep -v '#line ' ext/standard/url_scanner_ex.c.orig
+ for f in '$CLEANUP_FILES'
+ cp ext/standard/var_unserializer.c ext/standard/var_unserializer.c.orig
+ grep -v '#line ' ext/standard/var_unserializer.c.orig
该错误似乎是非致命的。
./buildconf
You should not run buildconf in a release package.
use buildconf --force to override this check.
这是与PHP-7.1.0
分支的一个问题 - master
不显示此错误。
为了确保一切都完全清洁,我抛弃了我的克隆并重新开始 - 这一次重新定义错误消失了,我的构建正在工作。最终这回答我的问题 - 这似乎是一个本地配置问题,但我不知道究竟是什么。
任何特定的原因(只是好奇)为什么你会去'建立'路线,因为○专注于使用'brew'? – YvesLeBorg
我正在解决PHP中的问题,所以我需要能够编译它。我也有它从自制软件安装,但这是一个我不需要触摸的工作版本。 – Synchro
啊......说得通。你可以用深度记录(不确定)来酿造,并找出它们的构造与你的构造有何不同。 – YvesLeBorg