On Tue, Sep 05, 2006 at 09:08:35PM -0700, William Balcerski wrote:
> Ok, I have Vanilla compiled on NETBSD, however there is 1 slight problem
> that I'd like to correct, but don't know how.  The configure program has
> a problem locating gdbm.  Relevant lines from configure printout:
> checking gdbm.h usability... no
> checking gdbm.h presence... no
> checking for gdbm.h... no
> checking for gdbm_open in -lgdbm... no

This also happens on FreeBSD.

It suggests your system is not configured in the way that the autoconf
generated script expects to find it.  Because it cannot find gdbm,
compilation will fail.

Your workaround has been to modify the Makefile.in and source files.

Another workaround is to prefix the configure command with an assignment
to the environment variables CFLAGS and LDFLAGS.  For example:

CFLAGS=-I/usr/pkg/include LDFLAGS=-L/usr/pkg/lib ./configure

> hunk ./Vanilla/ntserv/Makefile.in 73
> -LIBS = $(RSA_LIB) $(EXTRALIBS)
> +LIBS = $(RSA_LIB) $(EXTRALIBS) -L/usr/pkg/lib

This change is not required if you assign a value to LDFLAGS as above.

> hunk ./Vanilla/ntserv/Makefile.in 75
> -INCS = $(RSA_INCS) $(EXTRAINCS) -I../include
> +INCS = $(RSA_INCS) $(EXTRAINCS) -I../include -I/usr/pkg/include

This change is not required if you assign a value to CFLAGS as above.

> hunk ./Vanilla/ntserv/db.c 14
> -#include <gdbm.h>
> +#include </usr/pkg/include/gdbm.h>

This change is not required if either CFLAGS is assigned or if
-I/usr/pkg/include is used on the previous hunk.

> Does anyone have any idea why the configure script is not finding the
> gdbm.h header file in /usr/pkg/include?

It is probably not looking there.

The AC_CHECK_LIB macro is used to find the gdbm package files.  The
configure script expects the system to be properly configured so that a
C program containing "#include <gdbm.h>" will compile without further
ado.

The complete fix will be something you will have to contribute:

1.  change configure.in to check alternate locations if the AC_CHECK_LIB
for gdbm_open() fails, using the checks for -lmp and -lX11 as examples
for how this can be done,

2.  re-run autoconf after making the change,

3.  verify that the tree builds clean without having to apply your
patch.  Loop back to step 1 if this fails,

4.  verify that the build still works on Linux.

-- 
James Cameron    mailto:quozl at us.netrek.org     http://quozl.netrek.org/