Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
446 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 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...