internethering / hering-overlay

richard hering's gentoo overlay
4 stars 4 forks source link

dev-lang/php-5.6.40-r7 configure error #16

Closed zen2 closed 2 months ago

zen2 commented 4 months ago

I try to emerge dev-lang/php:5.6 but I got a configure error:

checking for system library directory... lib
checking whether to enable runpaths... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking for gawk... gawk
checking for bison... bison -y
checking for bison version... 3.8 (ok)
checking for re2c... re2c
checking for re2c version... 3.1 (ok)
checking whether to enable computed goto gcc extension with re2c... no
./configure: line 6381: test: too many arguments
checking whether to force non-PIC code in shared modules... no
checking whether /dev/urandom exists... yes
./configure: line 6809: syntax error near unexpected token `fi'
./configure: line 6809: `fi'

build.log.gz config.log

internethering commented 3 months ago

Sorry for late response. First I tested a ebuild php-5.6.40-r7.ebuild configure on my machines: >>> Source configured.

I try to emerge dev-lang/php:5.6 but I got a configure error:

./configure: line 6381: test: too many arguments

seems to be like a zentoo problem or a problem on your machine. the line 6381 in configure is:

if test -r "/dev/urandom" && test -c "/dev/urandom"; then is running fine on my gentoo machines and man test doesn't give a hint for „too many arguments”. /usr/bin/test is part of sys-apps/coreutils-9.4-r1

zen2 commented 3 months ago

seems to be like a zentoo problem or a problem on your machine. the line 6381 in configure is:

if test -r "/dev/urandom" && test -c "/dev/urandom"; then is running fine on my gentoo machines and man test doesn't give a hint for „too many arguments”. /usr/bin/test is part of sys-apps/coreutils-9.4-r1

Thanks to have took a look on this issue that I wish to solve because I hope to use this ebuild on some specific production servers.

BTW I can execute with success on all systems the following command as root or portage user : if test -r "/dev/urandom" && test -c "/dev/urandom"; then echo "OK"; fi

I have tried to install php:5.6 on several gentoo systems: two "unstable" ~amd64 and a stable amd64 ones with respectively sys-apps/coreutils-9.5 and sys-apps/coreutils-9.4-r1.

Results:

1) unstable ~amd64: configure phase failed on test: too many arguments I have downgraded sys-apps/coreutils to 9.4-r1 on ~amd64 and configure failed too. I don't think it's related to test command but to the building of test command arguments.

Anyway it means there is a problem on ~amd64 system. I let the unstable system on side for the moment and prefer to focus on stable system.

2) stable amd64: configure phase failed on configure: error: Don't know how to define struct flock on this system, set --enable-opcache=no

So I compile with USE="-opcache" and it compiles fine. A stackoverflow thread indicates this error could be the lack of ltdl libraries. So I emerge dev-libs/libltdl and try again with USE="+opcache" : it compiles fine !

=> So ebuild need dev-libs/libltdl dependency for USE=opcache.

Then I try to compile with all my needed USE: cmath berkdb curl exif flatfile fpm gd intl mysql mysqli pdo soap sqlite

Configure is OK but build failed on (first errors):

/var/tmp/portage/dev-lang/php-5.6.40-r7/work/sapis-build/cli/ext/intl/collator/collator_sort.c: In function 'zif_collator_sort':
/var/tmp/portage/dev-lang/php-5.6.40-r7/work/sapis-build/cli/ext/intl/collator/collator_sort.c:346:33: error: 'TRUE' undeclared (first use in this function)
  346 |         collator_sort_internal( TRUE, INTERNAL_FUNCTION_PARAM_PASSTHRU );
      |                                 ^~~~
/var/tmp/portage/dev-lang/php-5.6.40-r7/work/sapis-build/cli/ext/intl/collator/collator_sort.c:346:33: note: each undeclared identifier is reported only once for each function it appears in
/var/tmp/portage/dev-lang/php-5.6.40-r7/work/sapis-build/cli/ext/intl/collator/collator_sort.c: In function 'zif_collator_asort':
/var/tmp/portage/dev-lang/php-5.6.40-r7/work/sapis-build/cli/ext/intl/collator/collator_sort.c:538:33: error: 'FALSE' undeclared (first use in this function)
  538 |         collator_sort_internal( FALSE, INTERNAL_FUNCTION_PARAM_PASSTHRU );
      |                                 ^~~~~

=> It appear it is because of intl USE flag. It compile fine without this flag.

This issue seems related to icu. See:

So I modified src_configure() with:

    append-cflags -DU_DEFINE_FALSE_AND_TRUE=1
    append-cxxflags -DU_DEFINE_FALSE_AND_TRUE=1

Similar to https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b878520dc290dfc30177193882ac622ad99c799

And now everything compile fine with these USE flags.

Please find corresponding ebuild with both fixes: php-5.6.40-r7.ebuild.gz

Note: it still need to find the initial configure issue on ~amd64 as the problem may happen too on amd64 system in a near future.

zen2 commented 3 months ago

Update for ~amd64:

dev-lang/php:5.6 need dev-build/autoconf:2.71 because configure phase failed with dev-build/autoconf:2.72 on ~amd64 system. So I have added WANT_AUTOCONF="2.71" to the ebuild.

Furthermore I discover another missing dependencies: net-libs/c-client is needed for USE="+imap".

So this is the up to date ebuild that fixes:

=> php-5.6.40-r7.ebuild.gz

internethering commented 3 months ago

thanks for your great work, I added your ebuild now

internethering commented 2 months ago

make some tests and testet the php 7.4 ebuild too