Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
445 views
in Technique[技术] by (71.8m points)

compilation - How to pass LDFLAGS for ansi compiler

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?

question from:https://stackoverflow.com/questions/65926877/how-to-pass-ldflags-for-ansi-compiler

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...