ltb-project / openldap-deb

Debian packages for OpenLDAP
http://ltb-project.org/wiki/documentation/openldap-deb
GNU General Public License v3.0
14 stars 13 forks source link

explockout compilation fails when building openldap-ltb on Ubuntu 18.04 #26

Closed coudot closed 5 years ago

coudot commented 5 years ago

When building OpenLDAP LTB packages, I get this error:

libtool: install: warning: relinking `explockout.la'
(cd /home/clement/paquet-openldap-debian/openldap-ltb-2.4.47/ltb-project-openldap-explockout-1.0; /bin/bash ../libtool  --mode=relink gcc -g -O2 -Wall -fpic -DCONFIG_FILE="/opt/openldap-2.4.46-el/etc/openldap/explockout.conf" -DDEBUG -version-info 0:0:0 -rpath /home/clement/paquet-openldap-debian/openldap-ltb-2.4.47/debian/tmp/usr/local/openldap/libexec/openldap -module -o explockout.la explockout.lo -lldap_r -llber -L../libraries/liblber/.libs -L../libraries/libldap_r/.libs )
gcc -shared  .libs/explockout.o  -Wl,--rpath -Wl,/usr/local/openldap/lib64 -L/usr/local/openldap/lib64 -lldap_r -L/usr/local/berkeleydb/lib -llber  -Wl,-soname -Wl,explockout.so.0 -o .libs/explockout.so.0.0.0
/usr/bin/ld: cannot find -lldap_r
/usr/bin/ld: cannot find -llber
collect2: error: ld returned 1 exit status
libtool: install: error: relink `explockout.la' with the above command before installing it
Makefile:52: recipe for target 'install' failed
make[1]: *** [install] Error 1
make[1]: Leaving directory '/home/clement/paquet-openldap-debian/openldap-ltb-2.4.47/ltb-project-openldap-explockout-1.0'
debian/rules:41: recipe for target 'install' failed
make: *** [install] Error 2
davidcoutadeur commented 5 years ago

@coudot When you are in /home/clement/paquet-openldap-debian/openldap-ltb-2.4.47/ltb-project-openldap-explockout-1.0, the linker is trying to load libraries ldap_r and ber from directories ../libraries/liblber/.libs and ../libraries/libldap_r/.libs. Are these directories present ? Is it a problem of relative path?

coudot commented 5 years ago

I think the issue is on the contrary that we don't use ../libraries, but /usr/local/openldap/lib64, which does not exists until OpenLDAP LTB packages is installed. See the output of the commande on the first message.

coudot commented 5 years ago

It works if I installed openldap-ltb_2.4.47.1_amd64.deb package first to have libraries

davidcoutadeur commented 5 years ago

Yes, that's it: you have to install openldap package first. That's not wishable, because it introduces cyclic dependency: you need to install openldap to compile openldap... I'll try to find a fix. (I think libtool can help for this task)

coudot commented 5 years ago

I think we solved the issue with smbk5pwg overlay when setting LDAP_LIB:

## smbk5pwd
cd smbk5pwd
make clean
make "DEFS=-DDO_SAMBA -DDO_SHADOW" "HEIMDAL_LIB=" "LDAP_LIB=-L../../../libraries/liblber/.libs/ -L../../../libraries/libldap_r/.libs/ -lldap_r -llber" "prefix=${LDAPSERVERDIR}"
cd ..
davidcoutadeur commented 5 years ago

I will give a look, I can't do it now.

coudot commented 5 years ago

No problem, we have a workaround solution for the moment.

davidcoutadeur commented 5 years ago

I think it's a vicious bug in libtool. It's working the same way in smbk5pwd and in explockout. Only difference: the inst-prefix-dir command arg for smbk5pwd. I don't understand why it's added in this case and not mine. I will reinvestigate later.

davidcoutadeur commented 5 years ago

Should be ok now. @coudot could you test?

davidcoutadeur commented 5 years ago

@coudot: I assume this is fixed by b152c1f742b8701fa98416004ddb9b2f125bf4f3

davidcoutadeur commented 5 years ago

Supposed done in https://github.com/ltb-project/openldap-deb/releases/tag/v2.4.48