I have installed the latest SRPM for PHP (7.2.32-1), so that I can initially build it, then customise it, so that it uses /opt/freeware/etc/php.d instead of /etc/php.d, and to add additional modules that are not in the default php build (unixODBC and pdo-odbc for DB2 interaction, and some xml modules amongst others).
Applying patches during the prep phase defaults to using /opt/freeware/bin/patch, but patches applied in the spec file during the build phase do not use a pathed patch, so initially defaulted to /usr/bin/patch, which I worked around by moving /opt/freeware/bin to before /usr/bin in my PATH environment variable. Not sure if this is expected or not when using rpmbuild, or if the spec file should be fixed for running a pathed patch in the build phase.
Continuing on after patching in the build phase, libtool is invoked and compiles and links some files, but eventually breaks with the following problem.
/bin/sh /opt/freeware/src/packages/BUILD/php-7.2.32/64bit/build-cgi/libtool --silent --preserve-dup-deps --mode=link /opt/freeware/bin/gcc -fPIC -DPHP_ATOM_INC -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit/build-cgi/include -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit/build-cgi/main -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit/build-cgi/ext/date/lib -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit/ext/date/lib -I/opt/freeware/include/libxml2 -I/opt/freeware/include -I/opt/freeware/include/freetype2 -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit/build-cgi/TSRM -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit/build-cgi/Zend -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit/main -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit/Zend -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit/TSRM -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit/build-cgi/ -I/opt/freeware/include -Wl,-bbigtoc -I/usr/include/openssl -O2 -maix64 -I/opt/freeware/include -fvisibility=hidden -DZEND_SIGNALS -L/opt/freeware/lib64 -L/usr/lib64 -L/opt/freeware/lib -L/usr/lib -lm -lXpm -lpthread -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-G -o ext/soap/soap.la -export-dynamic -avoid-version -prefer-pic -module -rpath /opt/freeware/src/packages/BUILD/php-7.2.32/64bit/build-cgi/modules -L/opt/freeware/lib64 -L/opt/freeware/lib -lm -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -L/opt/freeware/lib ext/soap/soap.lo ext/soap/php_encoding.lo ext/soap/php_http.lo ext/soap/php_packet_soap.lo ext/soap/php_schema.lo ext/soap/php_sdl.lo ext/soap/php_xml.lo -L/opt/freeware/lib -L/opt/freeware/lib -L/opt/freeware/lib -L/opt/freeware/lib -L/opt/freeware/lib -L/opt/freeware/lib -lxml2 -lz -llzma -liconv -lm
grep_64: /opt/freeware/lib/libiconv.la: No such file or directory
/opt/freeware/bin/sed: can't read /opt/freeware/lib/libiconv.la: No such file or directory
libtool: link: `/opt/freeware/lib/libiconv.la' is not a valid libtool archive
make: *** [Makefile:1102: ext/soap/soap.la] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.T7LMab (%build)
I have the following RPMs relevant to this problem installed (amongst others)
automake 1.16.2-1
autoconf 2.69-1
grep 3.4-1
libiconv 1.16-1
libtool-ltdl-devel 2.4.6-2
libtool-ltdl 2.4.6-2
libtool 2.4.6-2
m4 1.4.17-1
sed 4.5-3
As the current and prior libiconv rpm packages do not contain a libtool.la file, the only way I can see around this is to create my own libiconv.la file, which is not ideal as it doesn't belong to the libiconv RPM package.
I must be building it in a different way to the AIX Toolbox team. Do you have a libiconv.la file on your build system that was not packaged in the libiconv rpm, or have I missed setting something, as I have not yet modified the php spec file as delivered from the SRPM.
------------------------------
Michael Jack
------------------------------
#AIXOpenSource