FreeBSD 8: gdbm.h: No such file or directory

Installing and maintaining the FreeBSD Ports Collection or FreeBSD Packages (i.e. third party software).

FreeBSD 8: gdbm.h: No such file or directory

Postby klabacita » 03 May 2010, 14:33

Hi.

I want to install http://www.csamuel.org/software/vacation/

Version vacation-1.2.7.0, the INSTALL say:

Code: Select all
under FreeBSD type 'gmake' to compile
the program.   To install it you will need to do (as root) 'make install'
or, for FreeBSD, 'gmake install'."


But went I run "gmake" i got:
Code: Select all
gcc  -g -Wall -DMAIN   -Xlinker -warn-common -D_PATH_VACATION=\"/usr/bin/vacation\" -o vacation vacation.c strlcpy.c strlcat.c rfc822.c -lgdbm
vacation.c:81:18: error: gdbm.h: No such file or directory
In file included from vacation.c:92:
vacation.h:61: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'db'
vacation.c: In function 'main':
vacation.c:200: error: 'db' undeclared (first use in this function)
vacation.c:200: error: (Each undeclared identifier is reported only once
vacation.c:200: error: for each function it appears in.)
vacation.c:200: warning: implicit declaration of function 'gdbm_open'
vacation.c:200: error: 'GDBM_NEWDB' undeclared (first use in this function)
vacation.c:200: error: 'GDBM_WRITER' undeclared (first use in this function)
vacation.c:222: warning: implicit declaration of function 'gdbm_close'
vacation.c: In function 'recent':
vacation.c:529: error: 'datum' undeclared (first use in this function)
vacation.c:529: error: expected ';' before 'key'
vacation.c:533: error: 'key' undeclared (first use in this function)
vacation.c:535: error: 'data' undeclared (first use in this function)
vacation.c:535: warning: implicit declaration of function 'gdbm_fetch'
vacation.c:535: error: 'db' undeclared (first use in this function)
vacation.c: In function 'setinterval':
vacation.c:567: error: 'datum' undeclared (first use in this function)
vacation.c:567: error: expected ';' before 'key'
vacation.c:569: error: 'key' undeclared (first use in this function)
vacation.c:571: error: 'data' undeclared (first use in this function)
vacation.c:573: warning: implicit declaration of function 'gdbm_store'
vacation.c:573: error: 'db' undeclared (first use in this function)
vacation.c:573: error: 'GDBM_REPLACE' undeclared (first use in this function)
vacation.c: In function 'setreply':
vacation.c:583: error: 'datum' undeclared (first use in this function)
vacation.c:583: error: expected ';' before 'key'
vacation.c:586: error: 'key' undeclared (first use in this function)
vacation.c:589: error: 'data' undeclared (first use in this function)
vacation.c:591: error: 'db' undeclared (first use in this function)
vacation.c:591: error: 'GDBM_REPLACE' undeclared (first use in this function)
gmake: *** [vacation] Error 1


I got gdbm from ports,

The Makefile is:
Code: Select all
SHELL           = /bin/sh
CC              = gcc
ARCH            = $(uname -m)
OS              = $(uname -s)
#
# Default CFLAGS for all builds, architecture flags get appended below.
CFLAGS          = $(RPM_OPT_FLAGS) -g -Wall -DMAIN
ifeq "$(ARCH)" "x86_64"
# Uncomment below for backwards compatibility of gdbm files.
#  CFLAGS       = $(CFLAGS) -m32
else
ifeq "$(ARCH)" "ppc"
  CFLAGS       = $(CFLAGS) -fsigned-char
else
ifeq "$(ARCH)" "ppc64"
  CFLAGS       = $(CFLAGS) -fsigned-char
endif
endif
endif

LFLAGS          = -Xlinker -warn-common
IFLAGS          =

LIBS            = -lgdbm
LINT            = lint -abchuvx
LLIBS           =


ifeq "$(OS)" "FreeBSD"
# PREFIX for FreeBSD
PREFIX          = /usr/local
IFLAGS          = -I/usr/local/include
LIBS            = -L/usr/local/lib -lgdbm
else
# PREFIX for Linux
PREFIX          = /usr
endif
# where things go
BINDIR          = $(PREFIX)/bin
VACATION        = $(BINDIR)/vacation
VACLOOK         = $(BINDIR)/vaclook
MANDIR          = $(PREFIX)/man/man
MANEXT1         = 1

VERSION         = 1
SUBVERSION      = 2
PATCHLEVEL      = 7

# what are we making
EXTRAS          = strlcpy.c strlcat.c rfc822.c
SRC             = vacation.c $(EXTRAS)
OBJ             = vacation.o
BIN             = vacation
HDR             = vacation.h

# what we are packaging
PACKAGE         = ChangeLog Makefile README tzfile.h \
                  vacation vacation.c vacation.h *.man COPYING rfc822.c \
                  contrib vacation-1.2.6.lsm patches OLD strlcpy.c strlcat.c
TGZFILE         = vacation-$(VERSION).$(SUBVERSION).$(PATCHLEVEL).tar.gz

# rules

all:    $(BIN)

install:  all
        install -s -m 755 $(BIN) $(VACATION)
        install -m 755 vaclook $(VACLOOK)
        ./html2man.pl < vacation.html > $(MANDIR)$(MANEXT1)/vacation.$(MANEXT1)
        install -m 444 vaclook.man $(MANDIR)$(MANEXT1)/vaclook.$(MANEXT1)

vacation:       $(SRC) $(HDR)
        $(CC) $(CFLAGS) $(IFLAGS) $(PFLAGS) $(LFLAGS) -D_PATH_VACATION=\"$(VACATION)\" -o $(BIN) $(SRC) $(LIBS)

courier:        $(SRC) $(HDR)
        $(CC) $(CFLAGS) $(IFLAGS) $(PFLAGS) $(LFLAGS) -DCOURIER -D_PATH_VACATION=\"$(VACATION)\" -o $(BIN) $(SRC) $(LIBS)
debug:  $(SRC) $(HDR)
        $(CC) $(CFLAGS) $(IFLAGS) -DDEBUG $(LFLAGS) -o $(BIN) $(SRC) $(LIBS)

clean:
        rm -f *.o core *.out *~ Makefile.old vacation

clobber: clean
        rm -f $(BIN)

package: all
        strip vacation
        tar cvf - $(PACKAGE) | gzip > ../$(TGZFILE)


vacation.c Line 81:

Code: Select all
#include <gdbm.h>


"In file included from vacation.c:92:" ===> static GDBM_FILE db; in vacation.h

Now, I copy /usr/local/include/gdbm.h to /usr/include

But now I got:

Code: Select all
gcc  -g -Wall -DMAIN   -Xlinker -warn-common -D_PATH_VACATION=\"/usr/bin/vacation\" -o vacation vacation.c strlcpy.c strlcat.c rfc822.c -lgdbm
/usr/bin/ld: cannot find -lgdbm
gmake: *** [vacation] Error 1


Perl is install with gdbm, what could cause the error?

Thanks!!!
klabacita
Member
 
Posts: 135
Joined: 17 Nov 2008, 17:47
Location: Aztec Land

Postby DutchDaemon » 03 May 2010, 14:39

You are trying to install the Linux port of FreeBSD's own [man=1]vacation[/man] program?
User avatar
DutchDaemon
Old Fart
 
Posts: 10467
Joined: 16 Nov 2008, 20:17
Location: The Netherlands

Postby crsd » 03 May 2010, 14:40

You could try using [man="1"]vacation[/man], which is in base.
crsd
Member
 
Posts: 420
Joined: 24 Nov 2008, 02:15
Location: Russia, Krasnodar

Postby klabacita » 03 May 2010, 19:13

Wow, guys I really appreciated this great forum, I didn't know that we have that small program at the ports.
Thanks both of u!!!
klabacita
Member
 
Posts: 135
Joined: 17 Nov 2008, 17:47
Location: Aztec Land

Postby SirDice » 03 May 2010, 19:16

It's not in the ports, it's part of the base freebsd operating system.
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
User avatar
SirDice
Old Fart
 
Posts: 16196
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands


Return to Installation and Maintenance of FreeBSD Ports or Packages

Who is online

Users browsing this forum: azcromntic, Bing [Bot], masayoshi, Yahoo [Bot] and 1 guest