Subject: Re: can't build woth mesa
To: None , None <netbsd-help@netbsd.org>
From: Richard Rauch <rauch@rice.edu>
List: netbsd-help
Date: 04/29/2002 13:34:45
(re: http://mail-index.netbsd.org/netbsd-help/2002/04/29/0003.html)

The problem has nothing to do with Mesa or OpenGL.

There are two problems with the Makefile that you find at the web site.
The first is that it is missing the ``-Wl,R'' options.  (At least on
NetBSD, when compiling for ELF (e.g., NetBSD/i386 as of 1.5), you *need*
to always say where all of your shared libraries are that you will use.
It doesn't matter that they are normally in the same locations as the
static linker uses.)

The second problem is that the line that says how to link bhole.o into
bhole is just bogus.  (Well, it might be legit for GNU make, but it's not
legit for a BSD make.)  $@ and $< seem to cause problems for me with the
BSD make, anyway.  (^&


Fixes:

 * Add a -Wl,-R/usr/X11R6/lib to the LIBDIR specification.

 * Change the last line FROM

     $(CC) $(CFLAGS) -o $@ $(LIBDIR) $< $(LIBRARIES)

   TO

     $(CC) $(CFLAGS) -o bhole $(LIBDIR) bhole.o $(LIBRARIES)

(There is, I believe, a BSD make equivalent to $@ and $<.  But if you make
the above change, the resulting Makefile will still work with the GNU make
as well as with any other make.)

(An alternative to the second fix is to build the GNU make (gmake) package
from pkgsrc and use that.)



I've compiled, linked, and run the bhole program.  I can't get it to
display anything other than the axes and the background starfield, though
(and the heads-up display).  (sigh)  (I can rotate my view around, but
can't see any particles, no matter how many I inject.


  ``I probably don't know what I'm talking about.'' --rauch@math.rice.edu