|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-04-24 15:12 UTC] bos at je-eigen-domein dot nl
Description: ------------ When cross-compiling PHP for a different architecture, configure fails if you specify the --enable-fpm option: == checking for ptrace... yes checking whether ptrace works... configure: error: in `/hdd/max/dev/raspberry/buildroot-berryserver/output/build/php-5.4.0': configure: error: cannot run test program while cross compiling See `config.log' for more details. == Obviously it is impossible to execute a test program when the system you are compiling on is not the target system. Attached a patch that skips running the test programs when cross-compiling. Patchesphp-configure-cross.patch (last revision 2014-06-13 17:07 UTC by sob at evomer-domein dot nl)tafoda (last revision 2014-06-13 14:28 UTC by fredy at tecsysbrasil dot com dot br) php-fpm-cross.patch (last revision 2012-04-24 15:13 UTC by bos at je-eigen-domein dot nl) Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 11:00:02 2025 UTC |
Had to dive a littl deeper because of cross-compileing php5.6.40 resulted, even ,with the patch, in a binary with unsupoorted extensions. Found that acincludes.m4-PHP_CHECK_FUNC_LIB cant compile its test in the cross-compile environment an so opts out with found=no reverting any other choice made before. Test: --- acinclude.m4 +++ acinclude.m4 @@ -1904,10 +1904,11 @@ AC_CHECK_LIB($2, __$1, [found=yes], [found=no]) ]) + // Add the opportunity to define how PHP_CHECK_FUNC_LIB handles a cross-build in configure.in if test "$found" = "yes"; then ac_libs=$LIBS LIBS="$LIBS -l$2" - AC_TRY_RUN([main() { return (0); }],[found=yes],[found=no],[found=no]) + AC_TRY_RUN([main() { return (0); }],[found=yes],[found=no],[found=$with_freetz_fix_cross]) LIBS=$ac_libs fi --- configure.in +++ configure.in @@ -453,10 +453,14 @@ PHP_CHECK_FUNC(gethostbyaddr, nsl) PHP_CHECK_FUNC(yp_get_default_domain, nsl) +# PHP_CHECK_FUNC->_AC_CHECK_FUNC->PHP_CHECK_FUNC_LIB +# Define how to call AC_TRY_RUN in PHP_CHECK_FUNC_LIB when cross-compiling") +$with_freetz_fix_cross=yes PHP_CHECK_FUNC(dlopen, dl) if test "$ac_cv_func_dlopen" = "yes"; then AC_DEFINE(HAVE_LIBDL, 1, [ ]) fi +$with_freetz_fix_cross=no AC_CHECK_LIB(m, sin) dnl Check for inet_aton have a nice day, Marcedo