configure can't find ltdl.h

1,537 views
Skip to first unread message

Matthew Pounsett

unread,
Jul 17, 2012, 11:14:11 AM7/17/12
to mod_g...@googlegroups.com
I'm trying to compile mod_gearman 1.3.4 on FreeBSD, and running into a problem where configure is inexplicably unable to find ltdl.h.  

checking for ltdl.h... no
configure: error: Compiling Mod-Gearman requires ltdl.h

It's definitely present:
% locate ltdl.h
/usr/local/include/ltdl.h
/usr/local/share/libtool/libltdl/ltdl.h

% portversion -v libltdl
libltdl-2.4.2               =  up-to-date with port 

On the off chance that configure wasn't searching /usr/local for some reason I attempted to set LDFLAGS, but that had no effect.

% setenv LDFLAGS "-L/usr/local/lib -I/usr/local/include"

The only other mention I've found of this is in a release notice for 1.2.4 which said that mod_gearman should work out of the box on FreeBSD from that point on.  Just in case I tried compiling 1.2.4 itself, but that had the same issue.

I'm attaching the relevant section of config.log, but it doesn't seem to provide much more information.  Although I do note that my LDFLAGS aren't present in the gcc commands.  In case configure wasn't picking up the LDFLAGS environment variable I also tried passing it on the configure command line, but that had no effect either.

Any thoughts from anyone?  

ltdl.log

Deives Michellis

unread,
Jul 17, 2012, 11:19:37 AM7/17/12
to mod_g...@googlegroups.com
arent you missing also CFLAGS=" -I/usr/local/include"? LDFLAGS are usually only used when linking, not when generating object code (".o")

Just my 2 cents

Deives

Matthew Pounsett

unread,
Jul 17, 2012, 11:23:48 AM7/17/12
to mod_g...@googlegroups.com
On Tuesday, 17 July 2012 11:19:37 UTC-4, Deives wrote:
arent you missing also CFLAGS=" -I/usr/local/include"? LDFLAGS are usually only used when linking, not when generating object code (".o")

Possibly, but adding that doesn't fix the problem either.

% echo $CFLAGS
-I/usr/local/include -L/usr/local/lib

% ./configure CFLAGS="-I/usr/local/include -L/usr/local/lib"
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
[...]
checking ltdl.h usability... no
checking ltdl.h presence... no
checking for ltdl.h... no
configure: error: Compiling Mod-Gearman requires ltdl.h

config.log looks no different either.

 

Matthew Pounsett

unread,
Jul 17, 2012, 11:29:08 AM7/17/12
to mod_g...@googlegroups.com
On Tuesday, 17 July 2012 11:23:48 UTC-4, Matthew Pounsett wrote:
config.log looks no different either.

Actually I take that back.  The ltdl section of config.log looks no different... I find this interesting:

% grep CFLAGS config.log 
  $ ./configure CFLAGS=-I/usr/local/include -L/usr/local/lib
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-I/usr/local/include -L/usr/local/lib'
CFLAGS='-Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -O -fPIC -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -s'

It looks like CFLAGS off the command line are picked up, and noted, but then not used.  config bug?

 

Matthew Pounsett

unread,
Jul 17, 2012, 12:00:28 PM7/17/12
to mod_g...@googlegroups.com

Okay.. eventually solved my own problem.   On line 2745 of configure, I changed:

CFLAGS="-Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -O -fPIC -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64"

into

CFLAGS="-Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -O -fPIC -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 $CFLAGS"

and this now works.  Looks like command-line CFLAGS were being overwritten by a hard-coded value in configure itself.

I now get this in config.log:

configure:5254: checking ltdl.h usability
configure:5254: gcc -c -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -O -fPIC -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -I/usr/local/include -L/usr/local/lib -s  conftest.c >&5

Much better.

Deives Michellis

unread,
Jul 17, 2012, 12:09:33 PM7/17/12
to mod_g...@googlegroups.com
erm... you have to have BOTH cflags and ldflags.add an CPPFLAGS and CXXFLAGS just to be sure...

env CFLAGS="-I/usr/local/include" CPPFLAGS="-I/usr/local/include" CXXFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" configure --....

Deives
Reply all
Reply to author
Forward
0 new messages