Bug 201140 - sysutils/am-utils gdbm-compatabilty
Summary: sysutils/am-utils gdbm-compatabilty
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-27 03:08 UTC by Walter Schwarzenfeld
Modified: 2015-09-17 01:12 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Walter Schwarzenfeld 2015-06-27 03:08:14 UTC
if I try to compile this with OPTION LDAP=on (default-option), I got  (FreeBSD-10.1-p13, Portversion 6.2,1):

libaminfo.a(info_ndbm.o): In function `ndbm_search':
info_ndbm.c:(.text+0x34): undefined reference to `dbm_pagfno'
libaminfo.a(info_ndbm.o): In function `ndbm_init':
info_ndbm.c:(.text+0x114): undefined reference to `dbm_pagfno'
collect2: error: ld returned 1 exit status


Compiles with poudriere, but in the port only with LDFLAGS="-L/usr/local/lib -lgdbm -lgdbm_compat" with gcc48 and clang.
Comment 1 Walter Schwarzenfeld 2015-06-27 13:00:35 UTC
For a reason I don't  know it ignores CONFIGURE_ARGS in the port Makefile.

if I change from

.if ${PORT_OPTIONS:MOPENLDAP}
USE_OPENLDAP=   yes
CONFIGURE_ARGS+=--with-ldap=yes \
               --enable-ldflags=-L${LOCALBASE}/lib \
              --enable-cppflags=-I${LOCALBASE}/include 

DOCS+=          README.ldap ldap-id.txt ldap.schema
PLIST_SUB+=     LDAP_DOC=""
.else
PLIST_SUB+=     LDAP_DOC="@comment "
CONFIGURE_ARGS+=--with-ldap=no
.endif

to

.if ${PORT_OPTIONS:MOPENLDAP}
USE_OPENLDAP=   yes
LDFLAGS+=       -L${LOCALBASE}/lib -lgdbm_compat
CONFIGURE_ARGS+=--with-ldap=yes 

DOCS+=          README.ldap ldap-id.txt ldap.schema
PLIST_SUB+=     LDAP_DOC=""
.else
PLIST_SUB+=     LDAP_DOC="@comment "
CONFIGURE_ARGS+=--with-ldap=no
.endif

it compiles fine.
Comment 2 Walter Schwarzenfeld 2015-06-27 13:55:43 UTC
It seems I know why:

.if ${PORT_OPTIONS:MOPENLDAP}
USE_OPENLDAP=	yes
LDFLAGS+=	-L${LOCALBASE}/lib -lgdbm_compat
ONFIGURE_ARGS+=--with-ldap=yes 
		--enable-ldflags=-L${LOCALBASE}/lib \
		--enable-cppflags=-I${LOCALBASE}/include 
DOCS+=		README.ldap ldap-id.txt ldap.schema
PLIST_SUB+=	LDAP_DOC=""
.else
PLIST_SUB+=	LDAP_DOC="@comment "
CONFIGURE_ARGS+=--with-ldap=no
.endif


with

OPENLDAP_CONFIGURE_WITH= ldap \
		-L${LOCALBASE}/lib \
		-I${LOCALBASE}/include

.if ${PORT_OPTIONS:MOPENLDAP}
USE_OPENLDAP=	yes
DOCS+=		README.ldap ldap-id.txt ldap.schema
PLIST_SUB+=	LDAP_DOC=""
.else
PLIST_SUB+=	LDAP_DOC="@comment "
.endif

And now theres no need for "-lgdbm -lgdbm_compat" in the Makefile.
I know there is a other way with the docs, but this I can't figure out.
Comment 3 Walter Schwarzenfeld 2015-06-27 14:00:30 UTC
Sorry after the line
It seems I know why:
i want to write:
If I change: