1

I am trying to cross-compile libnss-pam-ldapd for an arm architecture. The configure command always gives the following error:

checking for library containing ldap_search_ext... no
checking for ldap_search_ext... no
configure: error: could not locate a valid LDAP library

It is clear it's not finding the ldap library, despite having provide it in the configure command with the LDFLAGS enviromental variable. I'm sure the solution to the problem is simple, but so far I haven't been able to solve it.

This is my configure command:

export PATH=/home/andrea/cross-compiler/compiler/gcc-arm-linux-gnueabi/bin/:$PATH 
export CC=/home/andrea/cross-compiler/compiler/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-gcc 
export CPP=/home/andrea/cross-compiler/compiler/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-cpp 
export CFLAGS="-fPIC -D_GNU_SOURCE -marm -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9" 
export CPPFLAGS="-I/home/andrea/Sorgenti/openldap-2.4.57/include/"
export LDFLAGS="-L/home/andrea/Sorgenti/openldap-2.4.57/target_MOD/lib"

./configure \
--host=arm-linux-gnueabihf \
--prefix=/home/andrea/Sorgenti/nss-pam-ldapd-0.9.11/target \
--disable-kerberos \
--disable-pam \
--enable-nslcd \
--with-nslcd-pidfile=/home/andrea/Sorgenti/nss-pam-ldapd-0.9.11/target/var/run/nslcd \
--with-nslcd-socket=/home/andrea/Sorgenti/nss-pam-ldapd-0.9.11/target/var/run/nslcd/socket \
--disable-maintainer-mode \
--enable-sasl \
--with-nss-flavour=glibc \
--with-ldap-lib=openldap \
--with-ldap-conf-file=/home/andrea/Sorgenti/nss-pam-ldapd-0.9.11/target/etc/nslcd.conf \
--with-pam-seclib-dir=/home/andrea/Sorgenti/nss-pam-ldapd-0.9.11/target/lib/security

THis is the output of the configure command:

checking build system type... x86_64-pc-linux-gnu
checking host system type... arm-unknown-linux-gnueabihf
checking target system type... arm-unknown-linux-gnueabihf
configure: configuring nss-pam-ldapd 0.9.11
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-gnueabihf-strip... arm-linux-gnueabihf-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for arm-linux-gnueabihf-gcc... /home/andrea/cross-compiler/compiler/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-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... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /home/andrea/cross-compiler/compiler/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-gcc accepts -g... yes
checking for /home/andrea/cross-compiler/compiler/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-gcc option to accept ISO C89... none needed
checking whether /home/andrea/cross-compiler/compiler/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of /home/andrea/cross-compiler/compiler/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-gcc... gcc3
checking how to run the C preprocessor... /home/andrea/cross-compiler/compiler/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-cpp
checking for arm-linux-gnueabihf-ranlib... arm-linux-gnueabihf-ranlib
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /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
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether ln -s works... yes
checking for arm-linux-gnueabihf-ar... arm-linux-gnueabihf-ar
checking the archiver (arm-linux-gnueabihf-ar) interface... ar
checking for docbook2x-man... no
checking for tool to (re)generate man pages... no
configure: WARNING: docbook2x-man not found: not (re)generating man pages
checking whether to install man pages... yes
checking for a Python interpreter with version >= 2.7... python
checking for python... /usr/bin/python
checking for python version... 2.7
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/site-packages
checking python module: argparse... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether to build the NSS module... yes
checking whether to build the PAM module... no
checking whether to build the command-line utilities... yes
checking whether to build the nslcd daemon... yes
checking whether to build the pynslcd daemon... no
checking whether to enable SASL support... yes
checking whether to enable Kerberos support... no
checking whether to check configfile options... yes
checking location for PAM module... /home/andrea/Sorgenti/nss-pam-ldapd-0.9.11/target/lib/security
checking name of NSS and PAM modules... ldap
checking soname of NSS module... libnss_ldap.so.2
checking soname of PAM module... pam_ldap.so
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking for strings.h... (cached) yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking pthread_np.h usability... no
checking pthread_np.h presence... no
checking for pthread_np.h... no
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking nss.h usability... yes
checking nss.h presence... yes
checking for nss.h... yes
checking nss_common.h usability... no
checking nss_common.h presence... no
checking for nss_common.h... no
checking grp.h usability... yes
checking grp.h presence... yes
checking for grp.h... yes
checking shadow.h usability... yes
checking shadow.h presence... yes
checking for shadow.h... yes
checking aliases.h usability... yes
checking aliases.h presence... yes
checking for aliases.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking rpc/rpcent.h usability... no
checking rpc/rpcent.h presence... no
checking for rpc/rpcent.h... no
checking netinet/ether.h usability... yes
checking netinet/ether.h presence... yes
checking for netinet/ether.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking nsswitch.h usability... no
checking nsswitch.h presence... no
checking for nsswitch.h... no
checking nss_dbdefs.h usability... no
checking nss_dbdefs.h presence... no
checking for nss_dbdefs.h... no
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking sys/ucred.h usability... no
checking sys/ucred.h presence... no
checking for sys/ucred.h... no
checking ucred.h usability... no
checking ucred.h presence... no
checking for ucred.h... no
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for inline... inline
checking for an ANSI C-conforming const... yes
checking for sigaction... yes
checking for snprintf... yes
checking for library containing socket... none required
checking for strcasecmp... yes
checking for strncasecmp... yes
checking for strchr... yes
checking for strcspn... yes
checking for strspn... yes
checking for strtol... yes
checking for strtoul... yes
checking for strtoull... yes
checking for strndup... yes
checking for malloc... yes
checking for realloc... yes
checking for atexit... yes
checking for pid_t... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... cross
configure: WARNING: result yes guessed because of cross compilation
checking for working vfork... (cached) yes
checking for __assert_fail... yes
checking for library containing clock_gettime... none required
checking for setusershell... yes
checking for getusershell... yes
checking for endusershell... yes
checking for getgrouplist... yes
checking whether setusershell is declared... yes
checking whether getusershell is declared... yes
checking whether endusershell is declared... yes
checking for mode_t... yes
checking for size_t... yes
checking for uid_t in sys/types.h... yes
checking for pid_t... (cached) yes
checking for int32_t... yes
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking size of unsigned int... 4
checking size of unsigned long int... 4
checking size of unsigned long long int... 8
checking size of uid_t... 4
checking size of gid_t... 4
checking for thread local storage (TLS) class... __thread
checking for suseconds_t... yes
checking for struct ether_addr... yes
checking for ether_aton... yes
checking for ether_ntoa... yes
checking for ether_aton_r... yes
checking for ether_ntoa_r... yes
checking whether ether_aton is declared... yes
checking whether ether_ntoa is declared... yes
checking for socklen_t... yes
checking return type of setnetgrent... int
checking for struct aliasent... yes
checking for struct etherent... no
checking for struct passwd.pw_class... no
checking for struct rpcent... yes
checking for struct spwd... yes
checking for enum nss_status... yes
checking for nss_backend_t... no
checking for struct nss_XbyY_args.returnlen... no
checking which NSS flavour to build... glibc
checking which NSS maps to build... aliases,ethers,group,hosts,netgroup,networks,passwd,protocols,rpc,services,shadow
checking whether /usr/bin/python version is >= 2.7... yes
checking for /usr/bin/python version... (cached) 2.7
checking for /usr/bin/python platform... (cached) linux2
checking for /usr/bin/python script directory... (cached) ${prefix}/lib/python2.7/site-packages
checking for /usr/bin/python extension module directory... (cached) ${exec_prefix}/lib/python2.7/site-packages
checking python module: argparse... yes
checking lber.h usability... yes
checking lber.h presence... yes
checking for lber.h... yes
checking for ldap.h... yes
checking ldap_ssl.h usability... no
checking ldap_ssl.h presence... no
checking for ldap_ssl.h... no
checking gssldap.h usability... no
checking gssldap.h presence... no
checking for gssldap.h... no
checking sasl.h usability... no
checking sasl.h presence... no
checking for sasl.h... no
checking sasl/sasl.h usability... no
checking sasl/sasl.h presence... no
checking for sasl/sasl.h... no
checking gsssasl.h usability... no
checking gsssasl.h presence... no
checking for gsssasl.h... no
checking regex.h usability... yes
checking regex.h presence... yes
checking for regex.h... yes
checking for library containing gethostbyname... none required
checking for library containing hstrerror... none required
checking for library containing dlopen... -ldl
checking for initgroups... yes
checking for setgroups... yes
checking for execvp... yes
checking for execvpe... yes
checking for getpeereid... no
checking for getpeerucred... no
checking for __nss_configure_lookup... yes
checking for getenv... yes
checking for putenv... yes
checking for clearenv... yes
checking for dlopen... yes
checking for dlsym... yes
checking for dlerror... yes
checking for regcomp... yes
checking for regexec... yes
checking for regerror... yes
checking for hstrerror... yes
checking for getopt_long... yes
checking for strndup... (cached) yes
checking for ether_aton_r... (cached) yes
checking for struct sockaddr_storage... yes
checking for struct ucred... yes
checking if compiler needs -Werror to reject unknown flags... no
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
checking for pthread_mutex_lock... yes
checking for pthread_join... yes
checking for pthread_timedjoin_np... yes
checking for pthread_atfork... yes
checking for library containing ldap_search_ext... no
checking for ldap_search_ext... no
configure: error: could not locate a valid LDAP library

Thank you a lot.

1 Answers1

0

I had the same problem, had to add the following to LDFLAGS: -L<path to cyrus sasl> -lsasl2 -lldap -llber