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.
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.
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.
Sorry after the line It seems I know why: i want to write: If I change: