Subject: Re: devel/nss and Linux
To: Jeremy C. Reed <reed@reedmedia.net>
From: Borghart Steffen <borghart@gmx.de>
List: tech-pkg
Date: 08/24/2005 22:41:52
Hi,
has your patch been committed? i am still getting the 
"/usr/bin/ld: cannot find -lplc4" error when i try to build /devel/nss.
regards, borghart



On Fri, Aug 12, 2005 at 12:14:25PM -0700, Jeremy C. Reed wrote:
> On Thu, 7 Jul 2005, Matthew Luckie wrote:
> 
> >the patch below *should* fix this, but I'm unable to test and confirm it.
> >can you review/check?  It doesn't seem to break anything on my NetBSD
> >system.
> 
> I did it a little different. First my comments here and then my patch 
> below.
> 
> >+NSS_OBJ_DIR=   ${OPSYS}
> >+NSS_OBJ_DIR+=  ${SED} -e 's/^\([[:digit:]]\.[[:digit:]]\)\..*$/\1/'
> 
> The sed is not ran but added to this line. Also each component of this is 
> separated by a space.
> 
> >+.if ${MACHINE_ARCH} == "i386"
> >+NSS_OBJ_DIR+=  _x86
> 
> Also separated by a space.
> 
> ...
> >+NSS_OBJ_DIR+=  _glibc_PTH_OPT.OBJ
> 
> Missing /lib at end.
> 
> So I did it this way:
> 
> +.if ${OPSYS} == "NetBSD" || ${OPSYS} == "FreeBSD"
> +NSS_OBJ_DIR=	${OPSYS}${OS_VERSION}_OPT.OBJ
> +.elif ${OPSYS} == "Linux"
> +_NSS_SHORT_OS_VERSION!=	echo ${OS_VERSION} | ${SED} -e 
> 's/^\([[:digit:]]\.[[:digit:]]\)\..*$$/\1/'
> +.if ${MACHINE_ARCH} == "i386"
> +_NSS_MACHINE_ARCH=	_x86
> +.elif ${MACHINE_ARCH} == "parisc" || ${MACHINE_ARCH} == "parisc64"
> +_NSS_MACHINE_ARCH=	_hppa
> +.elif ${MACHINE_ARCH} == "sparc64"
> +_NSS_MACHINE_ARCH=	_sparc
> +.else
> +_NSS_MACHINE_ARCH=	_${MACHINE_ARCH}
> +.endif
> +NSS_OBJ_DIR= 
> ${OPSYS}${_NSS_SHORT_OS_VERSION}${_NSS_MACHINE_ARCH}_glibc_PTH_OPT.OBJ
> +.endif
> +
>  do-install:
>  	${INSTALL_DATA_DIR} ${PREFIX}/include/nss
>  	${INSTALL_DATA_DIR} ${PREFIX}/lib/nss
>  	(cd ${DIST}/public && ${PAX} -Lrwpe . ${PREFIX}/include/nss/ )
> -	(cd ${DIST}/${OPSYS}${OS_VERSION}_OPT.OBJ/lib && \
> +	(cd ${DIST}/${NSS_OBJ_DIR}/lib && \
>  		${PAX} -Lrwpe *.${SO_SUFFIX} ${PREFIX}/lib/nss/ )
> 
> 
> Also I changed the build to get rid of the BSD_LDOPTS to just define 
> LD_LIBS instead:
> 
> -MAKE_ENV=		BSD_LDOPTS="-L${BUILDLINK_PREFIX.nspr}/lib/nspr 
> ${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.nspr}/lib/nspr 
> ${COMPILER_RPATH_FLAG}${LOCALBASE}/lib/nss"
> +MAKE_ENV=		LD_LIBS="-L${BUILDLINK_PREFIX.nspr}/lib/nspr 
> ${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.nspr}/lib/nspr 
> ${COMPILER_RPATH_FLAG}${LOCALBASE}/lib/nss"
> 
> And the patch-af using BSD_LDOPTS can be removed.
> 
> I haven't tested this with DragonFly yet (for the PR #30711), but did some 
> testing with NetBSD 2.0.2 and Linux 2.6.x.
> 
>  Jeremy C. Reed
> 
>  	  	 	 BSD News, BSD tutorials, BSD links
> 	  	 	 http://www.bsdnewsletter.com/