Ошибка при компиляции apr-util для apache с поддержкой LDAP

В настоящее время я пытаюсь создать собственный 64-битный стек LAMPP на CentOS 7, в котором каждый компонент должен находиться в своей собственной папке со всеми включенными зависимостями и в своей собственной папке.

В настоящее время, У меня следующая структура с правильно скомпилированными программами:

- /opt/lampp64
  - apr
  - bzip2
  - cyrus-sasl
  - gdbm
  - libtool
  - ncurses
  - openldap
  - openssl
  - pcre
  - perl
  - readline
  - zlib

каждое программное обеспечение полностью содержится в своей папке, которая имеет:

  • отдельный каталог для каждой версии
  • simlink к "текущей" версия

Я загрузил исходники apr-util в последней версии и пытаюсь их скомпилировать, однако команда:

./configure --prefix=/opt/lampp64/apr-util/X.Y.Z --with-openssl=/opt/lampp64/openssl/current --with-openldap=/opt/lampp64/openldap/current

Не могу сказать, что он не может найти openldap, если я отключу его, все пройдет нормально.

Я знаю. это не стандартная структура каталогов, это просто эксперимент, однако другие программы с зависимостями уже были правильно скомпилированы.

Нужно ли мне добавлять какие-либо дополнительные параметры в configure , чтобы он «видел» библиотеки LDAP?

Это вся команда и вывод:

./configure --prefix=/opt/lampp64/apr-util/1.5.4 --with-apr=/opt/lampp64/apr/current --with-gdbm=/opt/lampp64/gdbm/current --with-openssl=/opt/lampp64/openssl/current --with-crypto --with-ldap=openldap --with-ldap-lib=/opt/lampp64/openldap/current/lib --with-ldap-include=/opt/lampp64/openldap/current/include
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking for working mkdir -p... yes
APR-util Version: 1.5.4
checking for chosen layout... apr-util
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
Applying apr-util hints file rules for x86_64-unknown-linux-gnu
checking for APR... yes
  setting CPP to "gcc -E"
  adding "-pthread" to CFLAGS
  adding "-DLINUX" to CPPFLAGS
  adding "-D_REENTRANT" to CPPFLAGS
  adding "-D_GNU_SOURCE" to CPPFLAGS
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
configure: checking for openssl in /opt/lampp64/openssl/current
checking openssl/x509.h usability... yes
checking openssl/x509.h presence... yes
checking for openssl/x509.h... yes
checking for BN_init in -lcrypto... yes
checking for SSL_accept in -lssl... yes
  setting APRUTIL_LDFLAGS to "-L/opt/lampp64/openssl/current/lib"
  setting APRUTIL_INCLUDES to "-I/opt/lampp64/openssl/current/include"
checking whether EVP_PKEY_CTX_new is declared... yes
  setting LDADD_crypto_openssl to "-L/opt/lampp64/openssl/current/lib  -lssl -lcrypto"
checking for const input buffers in OpenSSL... yes
checking for ldap support...
  adding "-I/opt/lampp64/openldap/current/include" to APRUTIL_INCLUDES
  adding "-L/opt/lampp64/openldap/current/lib" to APRUTIL_LDFLAGS
checking for ldap_init in -lopenldap... no
checking for ldap_init in -lopenldap... no
checking for ldap_init in -lopenldap... no
checking for ldap_init in -lopenldap... no
configure: error: could not find an LDAP library
1
задан 11 May 2016 в 20:48
2 ответа

В строке:

checking for ldap_init in -lopenldap... no

он пытается соединиться с библиотекой под названием openldap, но когда я смотрю в свой каталог openldap lib, я не вижу libopenldap.so :

liblber.so
libldap.so
libldap_r.so

Похоже, что значение в -lopenldap поступает из параметра - with-ldap = openldap , поэтому, если я изменю его на - с -ldap = ldap , похоже, работает.

Я не пробовал использовать все ваши варианты, поэтому не знаю, работает ли все остальное :)

0
ответ дан 3 December 2019 в 23:46

У меня была аналогичная проблема на RHEL7. Я компилировал apr-util против специально скомпилированного openssl. Оказывается, также был установлен пакет openssl-devel, который всегда не выполнял шаг ./configure в apr-util.

Так что для меня уловка заключалась в том, чтобы yum удалить openssl-devel и перекомпилировать весь стек (openssl, openldap, apr и апр-утиль)

1
ответ дан 3 December 2019 в 23:46

Теги

Похожие вопросы