Make fails with missing header file (OS X)


(Bruce Hobbs) #1

After downloading, unzipping, etc., configure seemed to work fine, but make failed as follows:

[localhost:~/Temporary/FTP downloads/ruby-1.6.7] bhobbs% make
gcc -g -O2 -fno-common -pipe -no-precomp -I. -I. -I/usr/local/include -c array.c
gcc -g -O2 -fno-common -pipe -no-precomp -I. -I. -I/usr/local/include -c bignum.c
gcc -g -O2 -fno-common -pipe -no-precomp -I. -I. -I/usr/local/include -c class.c
gcc -g -O2 -fno-common -pipe -no-precomp -I. -I. -I/usr/local/include -c compar.c
gcc -g -O2 -fno-common -pipe -no-precomp -I. -I. -I/usr/local/include -c dir.c
gcc -g -O2 -fno-common -pipe -no-precomp -I. -I. -I/usr/local/include -c dln.c
dln.c:1091: header file ‘dlfcn.h’ not found
cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode
make: *** [dln.o] Error 1

···

==========
I’m running Mac OS X 10.1.5 on a TiPB/500Mhz/1GB RAM/almost 2GB free disc space.

Incidentally, attempting to execute autoconf results in the following:

FATAL ERROR: Autoconf version 2.50 or higher is required for this script

Can anyone point me in the right direction? TIA!

Bruce Hobbs, CDP 856 N Monterey St Phone: 626-570-8028
Partner Alhambra, CA 91801-1574 Cell: 626-278-0273
Engineered Software brucehobbs@engineeredsw.com FAX: 208-474-0732


(Urban Nilsson) #2

I got that too, when trying to compile Ruby 1.7.2 on my
TiPB/MacOSX10.1.5. I got past that by (surprise!) installing
autoconf2.53 by using fink.
I did however run into another problem with the socket support
compilation:

···

compiling socket

Fatal: --enable-ipv6 is specified, and your OS seems to support IPv6
feature.
But your getaddrinfo() and getnameinfo() are appeared to be broken.
Sorry,
you cannot compile IPv6 socket classes with broken these functions.
You can try --enable-wide-getaddrinfo.

Where should I add the --enable-wide-getaddrinfo? Assuming it works,
ofcourse!

/U

On onsdag, juli 3, 2002, at 10:54 , Bruce Hobbs wrote:

After downloading, unzipping, etc., configure seemed to work fine, but
make failed as follows:

[localhost:~/Temporary/FTP downloads/ruby-1.6.7] bhobbs% make
gcc -g -O2 -fno-common -pipe -no-precomp -I. -I. -I/usr/local/include
-c array.c
gcc -g -O2 -fno-common -pipe -no-precomp -I. -I. -I/usr/local/include
-c bignum.c
gcc -g -O2 -fno-common -pipe -no-precomp -I. -I. -I/usr/local/include
-c class.c
gcc -g -O2 -fno-common -pipe -no-precomp -I. -I. -I/usr/local/include
-c compar.c
gcc -g -O2 -fno-common -pipe -no-precomp -I. -I. -I/usr/local/include
-c dir.c
gcc -g -O2 -fno-common -pipe -no-precomp -I. -I. -I/usr/local/include
-c dln.c
dln.c:1091: header file ‘dlfcn.h’ not found
cpp-precomp: warning: errors during smart preprocessing, retrying in
basic mode
make: *** [dln.o] Error 1

I’m running Mac OS X 10.1.5 on a TiPB/500Mhz/1GB RAM/almost 2GB free
disc space.

Incidentally, attempting to execute autoconf results in the following:

FATAL ERROR: Autoconf version 2.50 or higher is required for this script

Can anyone point me in the right direction? TIA!

Bruce Hobbs, CDP 856 N Monterey St Phone: 626-570-8028
Partner Alhambra, CA 91801-1574 Cell: 626-278-0273
Engineered Software brucehobbs@engineeredsw.com FAX: 208-474-0732


Urban Nilsson, Oops AB

“My inbox is a sacred shrine, none shall enter that are not worthy.”
–Ted.Dziuba


(Chris Gehlker) #3

[snip]

dln.c:1091: header file ‘dlfcn.h’ not found
cpp-precomp: warning: errors during smart preprocessing, retrying in basic
mode
make: *** [dln.o] Error 1

I’m running Mac OS X 10.1.5 on a TiPB/500Mhz/1GB RAM/almost 2GB free disc
space.

Can anyone point me in the right direction? TIA!

Ah, the famous “‘dlfcn.h’ not found”. This ought to be a FAQ.

Short Answer:
The easiest way around this problem is to temporarily adjust your PATH so
that fink’s sw directory is not in it. Others have reported success by
simply creating a file named dlfcn.h somewhere in their path

Semi-Informative Answer:
By default, the Ruby build will attempt to build in Tcl/Tk support. If you
aren’t running fink, this will simply fail and the build will continue. If
you are running fink, and have your PATH modified per the fink installer, it
will succeed just far enough to barf on the missing file.

Note that actually getting Cocoa Tcl/Tk to work with Ruby using only GNUMake
is beyond the ability of mere mortals. Both make and mkmf are too ignorant
of frameworks to look for headers in /System/Library/Frameworks. Visit the
Mac branch of Tcl/Tk on SourceForge for some pointers about how to do this
with Project Builder.

···

On 7/3/02 1:54 AM, “Bruce Hobbs” brucehobbs@engineeredsw.com wrote:

We ought not to treat living creatures like shoes or household belongings,
which when worn with use we throw away. -Plutarch, biographer (c. 46-120)


(Lyle Johnson) #4

“Bruce Hobbs” brucehobbs@engineeredsw.com wrote in message
news:p05111a01b9486b02632a@[192.168.1.123]…

Incidentally, attempting to execute autoconf results in the following:

FATAL ERROR: Autoconf version 2.50 or higher is required for this script

Ruby uses a newer version of autoconf than the one you’ve got installed on
your box. You need to download autoconf-2.50 (or higher) from the GNU ftp
site, e.g.

ftp://ftp.gnu.org/pub/gnu/autoconf/autoconf-2.53.tar.gz

and install it in order to be able to regenerate the “configure” script from
the “configure.in” input file.


(Evan Martin) #5

./configure --help
will list all of the compile-time options.

You could also try
./configure --disable-ipv6
unless you need ipv6…

···

On Wed, Jul 03, 2002 at 07:46:44PM +0900, Urban Nilsson wrote:

compiling socket

Fatal: --enable-ipv6 is specified, and your OS seems to support IPv6
feature.
But your getaddrinfo() and getnameinfo() are appeared to be broken.
Sorry,
you cannot compile IPv6 socket classes with broken these functions.
You can try --enable-wide-getaddrinfo.

Where should I add the --enable-wide-getaddrinfo? Assuming it works,
ofcourse!


Evan Martin
martine@cs.washington.edu
http://neugierig.org


(Bruce Hobbs) #6

At 11:13 PM +0900 on 7/3/2002, Chris Gehlker wrote:

Ah, the famous “‘dlfcn.h’ not found”. This ought to be a FAQ.

Shouldn’t configure have addressed this? Perhaps if I were running a version of autoconf newer than 2.13?

Short Answer:
The easiest way around this problem is to temporarily adjust your PATH so
that fink’s sw directory is not in it. Others have reported success by
simply creating a file named dlfcn.h somewhere in their path

I can confirm that a simple “touch dlfcn.h” in the Ruby directory was enough to permit the installation to complete successfully. Thanks!

Semi-Informative Answer:
By default, the Ruby build will attempt to build in Tcl/Tk support. If you
aren’t running fink, this will simply fail and the build will continue. If
you are running fink, and have your PATH modified per the fink installer, it
will succeed just far enough to barf on the missing file.

I’m very much of a newbie in this area and didn’t realize I was running fink. Here’s the value of $PATH:

/Users/bhobbs/bin/powerpc-apple-darwin:/Users/bhobbs/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/pgsql/bin:/usr/local/pgsql/man

Out of curiosity, exactly what would I have needed to remove?

···


Bruce Hobbs, CDP 856 N Monterey St Phone: 626-570-8028
Partner Alhambra, CA 91801-1574 Cell: 626-278-0273
Engineered Software brucehobbs@engineeredsw.com FAX: 208-474-0732


(Chris Gehlker) #7

At 11:13 PM +0900 on 7/3/2002, Chris Gehlker wrote:

Ah, the famous “‘dlfcn.h’ not found”. This ought to be a FAQ.

Shouldn’t configure have addressed this? Perhaps if I were running a version
of autoconf newer than 2.13?

Well, most folks don’t bother to rebuild configure from configure.in so the
version of autoconf doesn’t matter. If memory serves, you can still build
configure for Ruby 1.6.7 with autoconf 2.13.

Short Answer:
The easiest way around this problem is to temporarily adjust your PATH so
that fink’s sw directory is not in it. Others have reported success by
simply creating a file named dlfcn.h somewhere in their path

I can confirm that a simple “touch dlfcn.h” in the Ruby directory was enough
to permit the installation to complete successfully. Thanks!

Glad that helped.

Semi-Informative Answer:
By default, the Ruby build will attempt to build in Tcl/Tk support. If you
aren’t running fink, this will simply fail and the build will continue. If
you are running fink, and have your PATH modified per the fink installer, it
will succeed just far enough to barf on the missing file.

I’m very much of a newbie in this area and didn’t realize I was running fink.
Here’s the value of $PATH:

/Users/bhobbs/bin/powerpc-apple-darwin:/Users/bhobbs/bin:/usr/local/bin:/usr/b
in:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/pgsql/bin:/usr/local/pgsql/
man

Out of curiosity, exactly what would I have needed to remove?

I guess you aren’t running Fink because I don’t see sw in your path. The
only non-default things are the pgsql paths. Other than that, the paths are
pure default.

There are only a couple of places where the build might try to read dlfcn.h.
One is in dln.c where the condition is: #ifdef USE_DLN_DLOPEN and the other
is in stubs.c where the condition is: #elif defined HAVE_DLOPEN. Now this is
all from memory of someone else who had this problem, but, IIRC, make
searches for some file and if it finds it, it sets -DHAVE_DLOPEN.

I assume that it is finding this key file in /usr/local/pgsql/bin but I’ll
let you track it down if you care. The irony is that the real dlfcn.h only
prototypes some functions for AIX. It can be an empty file everywhere else.

···

On 7/3/02 10:42 AM, “Bruce Hobbs” brucehobbs@engineeredsw.com wrote:

Some people say Windows users have an inferiority complex.
That’s not true. It’s not a complex.


(Urban Nilsson) #8

It seems that the ./configure --disable-ipv6 was necessary on MacOSX. If
it isn’t fixed in the next release of Ruby, it might get fixed in OS X
10.2 in the fall. I wouldn’t hold my breath for ipv6 to be ubiquitous
anyway!

/U

···

On onsdag, juli 3, 2002, at 04:10 , Evan Martin wrote:

On Wed, Jul 03, 2002 at 07:46:44PM +0900, Urban Nilsson wrote:

compiling socket

Fatal: --enable-ipv6 is specified, and your OS seems to support IPv6
feature.
But your getaddrinfo() and getnameinfo() are appeared to be broken.
Sorry,
you cannot compile IPv6 socket classes with broken these functions.
You can try --enable-wide-getaddrinfo.

Where should I add the --enable-wide-getaddrinfo? Assuming it works,
ofcourse!

./configure --help
will list all of the compile-time options.

You could also try
./configure --disable-ipv6
unless you need ipv6…


Evan Martin
martine@cs.washington.edu
http://neugierig.org


Urban Nilsson, Oops AB

“My inbox is a sacred shrine, none shall enter that are not worthy.”
–Ted.Dziuba


(Bruce Hobbs) #9

At 8:56 AM +0900 on 7/4/2002, Chris Gehlker wrote:

Well, most folks don’t bother to rebuild configure from configure.in so the
version of autoconf doesn’t matter. If memory serves, you can still build
configure for Ruby 1.6.7 with autoconf 2.13.

I only tried autoconf after I encountered the missing file. And, autoconf 2.13 did not work with Ruby 1.6.7, at least not for me.

There are only a couple of places where the build might try to read dlfcn.h.
One is in dln.c where the condition is: #ifdef USE_DLN_DLOPEN and the other
is in stubs.c where the condition is: #elif defined HAVE_DLOPEN. Now this is
all from memory of someone else who had this problem, but, IIRC, make
searches for some file and if it finds it, it sets -DHAVE_DLOPEN.

The error pointed at dln.c.

I assume that it is finding this key file in /usr/local/pgsql/bin but I’ll
let you track it down if you care.

There seem to be two references to HAVE_DLOPEN in dln.c:

#ifdef CHECKER
#undef HAVE_DLOPEN
#undef USE_DLN_A_OUT
#undef USE_DLN_DLOPEN
#endif

#if defined(HAVE_DLOPEN) && !defined(USE_DLN_A_OUT) && !defined(_AIX)
/* dynamic load with dlopen() */

define USE_DLN_DLOPEN

#endif

But the error appears to be coming from here:

#ifdef USE_DLN_DLOPEN

ifdef NetBSD

include <nlist.h>

include <link.h>

else

include <dlfcn.h>

endif

#endif

Since, thanks to you, I was able to workaround the problem I think I’ll just let it drop for now. My head hurts just looking at the definitions, much less trying to figure out exactly where things went wrong.

The irony is that the real dlfcn.h only
prototypes some functions for AIX. It can be an empty file everywhere else.

Given that’s the case it wouldn’t seem all that difficult to “fix” things so this wouldn’t happen. Easy for me to say. :wink:

···


Bruce Hobbs, CDP 856 N Monterey St Phone: 626-570-8028
Partner Alhambra, CA 91801-1574 Cell: 626-278-0273
Engineered Software brucehobbs@engineeredsw.com FAX: 208-474-0732