Your Location is: Home > Compiler-errors

How to pass LDFLAGS for ansi compiler

From: Pyongyang View: 4156 elbarna 

Question

I want to compile krb5 with openldap support on HPUX, gcc is too outdated(4!) so I use the HP ansi compiler

I run this script

export CC="/opt/aCC/bin/cc"
export AR="/usr/ccs/bin/ar"
export LD="/usr/ccs/bin/ld"

# Compile
cd krb5-$VERSION
cd src
./configure \
  --prefix=/opt/krb5 \
  --sbindir=/opt/krb5/sbin \
  --mandir=/opt/krb5/man \
  --docdir=/opt/krb5/doc \
  --sysconfdir=/etc \
  --localstatedir=/var/opt/krb5 \
  --runstatedir=/var/opt/krb5/run \
  --enable-dns-for-realm \
  --with-ldap LDFLAGS='-L/usr/local/lib/hpux64'

But return this error

checking ldap.h usability... yes
checking ldap.h presence... yes
checking for ldap.h... yes
checking lber.h usability... yes
checking lber.h presence... yes
checking for lber.h... yes
checking for ldap_str2dn in -lldap... no
configure: error: libldap not found or missing ldap_str2dn

the function is present

nm /usr/local/lib/hpux64/libldap.a | grep str2dn                               
[158]    |                     0|     240|FUNC |GLOB |0|   .text|ldap_str2dn
[35]     |                     0|       0|FUNC |GLOB |0|   UNDEF|ldap_str2dn

the includes are found, the libraries not, why?How to pass nonstandard path to ansi compiler?

Best answer