Subject: pkg/32969: problems building mail/gld with pgsql
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <oster@cs.usask.ca>
List: pkgsrc-bugs
Date: 03/02/2006 19:25:00
>Number:         32969
>Category:       pkg
>Synopsis:       problems building mail/gld with pgsql
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 02 19:25:00 +0000 2006
>Originator:     oster@cs.usask.ca
>Release:        NetBSD 3.0
>Organization:
>Environment:
System: NetBSD mickey 3.0 NetBSD 3.0 (GENERIC) #0: Sun Dec 18 12:14:58 CST 2005 oster@gonzo:/u1/builds/build94/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:

  gld should be able to work with a pgsql database instead of a mysql
database.  And even though there are hints that mail/gld should be 
easily configurable for pgsql, that doesn't currently seem to be the case.
Items of lossage include:

1) specifying:

 PKG_OPTIONS.gld=pgsql

in /etc/mk.conf gets me:

===> Choose one option: mysql or pgsql.
*** Error code 1

2) specifying:

 PKG_OPTIONS.gld=pgsql -mysql

gets me further along, but in the end it tries to link with
mysqlclient, and I end up with:


cc -O2  -DHAVE_SYS_TIME_H=1 -DHAVE_SYSLOG_H=1 -DHAVE_NETDB_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_SELECT=1 -DHAVE_STRSTR=1 -DHAVE_FORK=1 -DHAVE_ACCEPT=1 -DHAVE_WAIT=1 -DHAVE_SHUTDOWN=1 -DHAVE_GETHOSTBYNAME=1 -DHAVE_BZERO=1 -DHAVE_BCOPY=1 -DHAVE_CONNECT=1 -DHAVE_BIND=1 -DHAVE_SENDTO=1 -DHAVE_GETHOSTBYADDR=1 -DHAVE_GETPEERNAME=1 -DHAVE_SETSOCKOPT=1 -DHAVE_WAITPID=1 -DHAVE_SSCANF=1  -Wall server.o sql.o sockets.o cnf.o greylist.o  -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/lib -Wl,-R/usr/lib -lmysqlclient -o gld
ld: cannot find -lmysqlclient
*** Error code 1

Also note from the above that no "-lpq" appears in the above, so even
if "-lmysqlclient" is removed, the postgresql libraries would not be
linked.

3) If I bash options.mk to add:

 LDFLAGS+=       -lpq

for the ".if !empty(PKG_OPTIONS:Mpgsql)" case, and remove
"-lmysqlclient" from patches/patch-aa , and then change options.mk
so it reads:

#PKG_SUGGESTED_OPTIONS= mysql
PKG_SUGGESTED_OPTIONS=  pgsql

then it will build+link gld with the postgresql bits.  However, when
it prints the MESSAGE file, it only prints the information related to
the mysql setup.  (i.e. it doesn't talk about pgsql, or about the
existence of tables.pgsql )


All this said, I havn't actually tested gld with postgresql at this
point -- all I've done is got it to build and link.

>How-To-Repeat:
	see above.
>Fix:
	workarounds above.  I doubt they are entirely the proper fix.