Компиляция PHP 5.3 в Ubuntu 14.04 — libtool: ошибка несоответствия версии

У меня есть свойство php, которое мы пытаемся перенести с CentOS 6 на Ubuntu 14.04. Это свойство в настоящее время работает на php 5.3 и не может быть обновлено до более поздней версии в отведенное время из-за конфликтов пакетов (это высечено в камне и не в моих руках, проект на следующий год).

В Ubuntu есть пакет для php 5.3, который в настоящее время поддерживается в версии 12.04. Что я хотел бы сделать, так это перекомпилировать этот существующий пакет 14.04. Я понимаю, что нам придется делать это периодически, чтобы не отставать от пакетов безопасности или иметь дело с откатом некоторых версий пакетов, чтобы они работали с php 5.3. Эта работа была признана приемлемой.

Вот в чем проблема, хотя теоретически код должен нормально работать в 14.04 (мы скомпилировали ванильную версию без проблем), файлы autotools нам подходят.

После запуска configure с нашими параметрами получаем следующее:

root@ubuntu:~/php5-5.3.10# make
/bin/sh /home/user/php5-5.3.10/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/date/lib -Iext/date/ -I/home/user/php5-5.3.10/ext/date/ -DPHP_ATOM_INC -I/home/user/php5-5.3.10/include -I/home/user/php5-5.3.10/main -I/home/user/php5-5.3.10 -I/home/user/php5-5.3.10/ext/date/lib -I/home/user/php5-5.3.10/ext/ereg/regex -I/usr/include/libxml2 -I/home/user/php5-5.3.10/ext/sqlite3/libsqlite -I/home/user/php5-5.3.10/TSRM -I/home/user/php5-5.3.10/Zend    -I/usr/include -g -O2 -fvisibility=hidden  -c /home/user/php5-5.3.10/ext/date/php_date.c -o ext/date/php_date.lo
/home/user/php5-5.3.10/libtool: 481: /home/user/php5-5.3.10/libtool: CDPATH: not found
libtool: Version mismatch error.  This is libtool 2.4 Debian-2.4-2ubuntu1, but the
libtool: definition of this LT_INIT comes from an older release.
libtool: You should recreate aclocal.m4 with macros from libtool 2.4 Debian-2.4-2ubuntu1
libtool: and run autoconf again.
make: *** [ext/date/php_date.lo] Error 63

При поиске подобных вопросов предлагается стереть файлы aclocal.m4 и воссоздать их с помощью aclocal. Это ничего не изменит. Некоторые дальнейшие раскопки предлагают перегенерировать скрипт конфигурации с помощью autoreconf -i. Выполнение этого и повторный запуск configure приводит к следующему результату:

root@ubuntu:~/php5-5.3.10# ./configure --prefix=/opt/php53
cat: confdefs.h: No such file or directory
./configure: 392: ./configure: ac_fn_c_try_run: not found
./configure: 408: ./configure: 5: Bad file descriptor
./configure: 408: ./configure: :: checking for pthreads_cflags: not found
./configure: 409: ./configure: 6: Bad file descriptor
./configure: 409: ./configure: checking for pthreads_cflags... : not found
cat: confdefs.h: No such file or directory
./configure: 448: ./configure: ac_fn_c_try_run: not found
cat: confdefs.h: No such file or directory
./configure: 448: ./configure: ac_fn_c_try_run: not found
cat: confdefs.h: No such file or directory
./configure: 448: ./configure: ac_fn_c_try_run: not found
cat: confdefs.h: No such file or directory
./configure: 448: ./configure: ac_fn_c_try_run: not found
cat: confdefs.h: No such file or directory
./configure: 448: ./configure: ac_fn_c_try_run: not found
cat: confdefs.h: No such file or directory
./configure: 448: ./configure: ac_fn_c_try_run: not found
cat: confdefs.h: No such file or directory
./configure: 448: ./configure: ac_fn_c_try_run: not found
cat: confdefs.h: No such file or directory
./configure: 448: ./configure: ac_fn_c_try_run: not found
./configure: 471: ./configure: 5: Bad file descriptor
./configure: 471: ./configure: :: result: : not found
./configure: 472: ./configure: 6: Bad file descriptor
./configure: 472: ./configure: : Permission denied
./configure: 474: ./configure: 5: Bad file descriptor
./configure: 474: ./configure: :: checking for pthreads_lib: not found
./configure: 475: ./configure: 6: Bad file descriptor
./configure: 475: ./configure: checking for pthreads_lib... : not found
cat: confdefs.h: No such file or directory
./configure: 514: ./configure: ac_fn_c_try_run: not found
cat: confdefs.h: No such file or directory
./configure: 514: ./configure: ac_fn_c_try_run: not found
cat: confdefs.h: No such file or directory
./configure: 514: ./configure: ac_fn_c_try_run: not found
./configure: 536: ./configure: 5: Bad file descriptor
./configure: 536: ./configure: :: result: : not found
./configure: 537: ./configure: 6: Bad file descriptor
./configure: 537: ./configure: : Permission denied
./configure: 612: ./configure: 5: Bad file descriptor
./configure: 612: ./configure: :: result: : not found
./configure: 613: ./configure: 6: Bad file descriptor
./configure: 613: ./configure: : Permission denied
./configure: 614: ./configure: 5: Bad file descriptor
./configure: 614: ./configure: :: result: Configuring SAPI modules: not found
./configure: 615: ./configure: 6: Bad file descriptor
./configure: 615: ./configure: Configuring SAPI modules: not found
./configure: 642: ./configure: 5: Bad file descriptor
./configure: 642: ./configure: :: checking for AOLserver support: not found
./configure: 643: ./configure: 6: Bad file descriptor
./configure: 643: ./configure: checking for AOLserver support... : not found
./configure: 879: ./configure: 5: Bad file descriptor
./configure: 879: ./configure: :: result: no: not found
./configure: 880: ./configure: 6: Bad file descriptor
./configure: 880: ./configure: no: not found
./configure: 907: ./configure: 5: Bad file descriptor
./configure: 907: ./configure: :: checking for Apache 1.x module support via DSO through APXS: not found
./configure: 908: ./configure: 6: Bad file descriptor
./configure: 908: ./configure: checking for Apache 1.x module support via DSO through APXS... : not found
./configure: 1219: ./configure: 5: Bad file descriptor
./configure: 1219: ./configure: :: result: no: not found
./configure: 1220: ./configure: 6: Bad file descriptor
./configure: 1220: ./configure: no: not found
./configure: 1245: ./configure: 5: Bad file descriptor
./configure: 1245: ./configure: :: checking for Apache 1.x module support: not found
./configure: 1246: ./configure: 6: Bad file descriptor
./configure: 1246: ./configure: checking for Apache 1.x module support... : not found
./configure: 2105: ./configure: 5: Bad file descriptor
./configure: 2105: ./configure: :: result: no: not found
./configure: 2106: ./configure: 6: Bad file descriptor
./configure: 2106: ./configure: no: not found
./configure: 2117: ./configure: 5: Bad file descriptor
./configure: 2117: ./configure: :: checking whether to enable Apache charset compatibility option: not found
./configure: 2118: ./configure: 6: Bad file descriptor
./configure: 2118: ./configure: checking whether to enable Apache charset compatibility option... : not found
./configure: 2131: ./configure: 5: Bad file descriptor
./configure: 2131: ./configure: :: result: no: not found
./configure: 2132: ./configure: 6: Bad file descriptor
./configure: 2132: ./configure: no: not found
./configure: 2281: ./configure: 5: Bad file descriptor
./configure: 2281: ./configure: :: checking for Apache 2.0 filter-module support via DSO through APXS: not found
./configure: 2282: ./configure: 6: Bad file descriptor
./configure: 2282: ./configure: checking for Apache 2.0 filter-module support via DSO through APXS... : not found
./configure: 3153: ./configure: 5: Bad file descriptor
./configure: 3153: ./configure: :: result: no: not found
./configure: 3154: ./configure: 6: Bad file descriptor
./configure: 3154: ./configure: no: not found
./configure: 3181: ./configure: 5: Bad file descriptor
./configure: 3181: ./configure: :: checking for Apache 2.0 handler-module support via DSO through APXS: not found
./configure: 3182: ./configure: 6: Bad file descriptor
./configure: 3182: ./configure: checking for Apache 2.0 handler-module support via DSO through APXS... : not found
./configure: 4053: ./configure: 5: Bad file descriptor
./configure: 4053: ./configure: :: result: no: not found
./configure: 4054: ./configure: 6: Bad file descriptor
./configure: 4054: ./configure: no: not found
*** snipped a lot out of the middle, you get the idea ***
cat: confdefs.h: No such file or directory
./configure: 12860: ./configure: ac_fn_c_try_compile: not found
./configure: 12944: ./configure: 5: Bad file descriptor
./configure: 12944: ./configure: :: result: no: not found
./configure: 12945: ./configure: 6: Bad file descriptor
./configure: 12945: ./configure: no: not found
./configure: 1: ./configure: ac_cv_header_dirent_dirent.h: not found
./configure: 12955: ./configure: 5: Bad file descriptor
./configure: 12955: ./configure: :: checking for dirent.h that defines DIR: not found
./configure: 12956: ./configure: 6: Bad file descriptor
./configure: 12956: ./configure: checking for dirent.h that defines DIR... : not found
./configure: 1: eval: Bad substitution

На данный момент мы несколько в растерянности. Некоторые дальнейшие раскопки предполагают проблему с версиями с autoreconf или autotools, но никто из нас не знает, как это исправить.

На самом деле мы не занимаемся разработкой на C и не занимаемся сборкой из исходников, если можем этого избежать, однако в данном случае это неизбежно. Сборка на 12.04 также не вариант, так как нет утвержденного базового образа. Это должно быть каким-то образом запущено 14.04.

изменить: попробовать предложения из этой темы ошибка несоответствия версии libtool, т.е. стереть все файлы autoconf и восстановить их с autoconf --force --install тоже не работает. ./configure дает тот же результат, что и выше. Похоже, что сценарий начальной загрузки или autogen.sh не зарегистрирован с исходным кодом из php 5.3 в Ubuntu 12.02.


person jameswilsongrant    schedule 25.04.2016    source источник
comment
Что вам дает autoreconf -i -f -v ; automake?   -  person nneonneo    schedule 25.04.2016
comment
Извините, вывод не помещается в блок комментариев. См. этот pastebin pastebin.com/zs0HTGbP В основном autoreconf -i -f -v говорит, что я даю это плохо синтаксис. automake выдает кучу вывода. Сценарий configure по-прежнему не работает с указанными выше ошибками.   -  person jameswilsongrant    schedule 25.04.2016
comment
Autoreconf — это версия 2.13, полученная в результате запуска apt-get install autoreconf2.13 в другом потоке с похожей проблемой.   -  person jameswilsongrant    schedule 25.04.2016
comment
Неудивительно, что automake терпит неудачу, поскольку automake зависит от autoconf и друзей. Вы используете очень старую версию autoconf. Есть ли какая-то конкретная причина избегать последней версии (2.69)?   -  person nneonneo    schedule 25.04.2016
comment
Запуск ./buildconf в php5.3 ищет autoconf2.13, он не будет работать с более новыми версиями. PHP 5.3 в каждом современном дистрибутиве является EOL с 2014 года, однако CentOS 6 по-прежнему поставляется с исправлениями ошибок RedHat и обновлениями безопасности. Это очень старый (и, к счастью, очень прибыльный, иначе у меня не было бы столько проблем) проект.   -  person jameswilsongrant    schedule 25.04.2016
comment
Я полагаю, что запуск apt-get install autoconf2.13 в Ubuntu 14.04 также устанавливает соответствующую версию automake, как я предполагаю, именно для этой ситуации (т. е. autoconf 2.13 поставлялся в предыдущей версии LTS, и вам нужно что-то собрать оттуда). Automake --version говорит, что это 1.14.1   -  person jameswilsongrant    schedule 25.04.2016
comment
Ну что ж, можешь попробовать autoreconf -f -i --verbose. Надеюсь, это напечатает что-то полезное.   -  person nneonneo    schedule 25.04.2016