Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Jan 2000 23:01:14 -0800
From:      Jeremy Lea <reg@FreeBSD.ORG>
To:        Kris Kennaway <kris@hub.FreeBSD.ORG>
Cc:        ports@FreeBSD.ORG
Subject:   Re: USA_OPENSSL
Message-ID:  <20000122230114.K10368@shale.csir.co.za>
In-Reply-To: <Pine.BSF.4.21.0001221840430.86781-100000@hub.freebsd.org>; from kris@hub.FreeBSD.ORG on Sat, Jan 22, 2000 at 06:46:28PM -0800
References:  <Pine.BSF.4.21.0001221840430.86781-100000@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

I can't test this because of "enhancements" in my bsd.port.mk, but some
comments and explainations.

On Sat, Jan 22, 2000 at 06:46:28PM -0800, Kris Kennaway wrote:
> @@ -653,6 +653,38 @@
>  MAKE_ENV+=		CC=${CC} CXX=${CXX}
>  .endif

If you want this to set variables which a port's Makefile can use then
it must be included in bsd.port.pre.mk.  This is the section enclosed in
!defined(AFTERPORTMK) in bsd.port.mk.  I'd suggest right at the end -
after the setting of PREFIX.

> +.if defined(USE_OPENSSL)
> +.if ${OSVERSION} >= 400014 && exists(/usr/lib/libcrypto.so)
> +.if ${USE_OPENSSL} == RSA
> +_HASRSA= "`/usr/bin/nm /usr/lib/libcrypto.a | ${GREP} RSA_free`"
> +.if empty(_HASRSA)

You test for .so and then use .a - this might lead to problems.  Also,
in bsd.port.pre.mk GREP is not available.  Something like:

+_HASRSA!=	/usr/bin/nm /usr/lib/libcrypto.a | /usr/bin/grep RSA_free

> +.BEGIN:
> +	@${ECHO} ">>> This port requires RSA crypto, which is not present in your"
> +	@${ECHO} ">>> version of OpenSSL. Please see Chapter XX in the FAQ for"
> +	@${ECHO} ">>> a description of the problem and alternative solutions."
> +	@${FALSE}

'>>>' is used to introduce stages in the make process.  Messages are
best just echoed.

> +CFLAGS+=		-DNO_IDEA

Is this good enough for some ports to detect if they can support IDEA
based crypto (eg via GNU configure)?  Maybe you need:

OPENSSL_IDEA=	no

(bsd.port.mk uses lower case yes and no, unlike make.conf)

> +LIB_DEPENDS+=	crypto.1:${PORTSDIR}/security/openssl
> +OPENSSLBASE=	${LOCALBASE}
> +OPENSSLDIR=		${LOCALBASE}/openssl
> +.endif

What about people (there are some crazy ones :) who play with PREFIX?

+LIB_DEPENDS+=	crypto.1:${PORTSDIR}/security/openssl
+OPENSSLBASE?=	${LOCALBASE}
+OPENSSLDIR?=		${OPENSSBASE}/openssl
+.endif
 
> +OPENSSLLIB=		${OPENSSLBASE}/lib
> +OPENSSLINC=		${OPENSSLBASE}/include
> +MAKE_ENV+=		OPENSSLLIB=${OPENSSLLIB} OPENSSLINC=${OPENSSLINC} \
> +				OPENSSLBASE=${OPENSSLBASE} OPENSSLDIR=${OPENSSLDIR}

Do you also need to pass these to configure?  Or are most configure
scripts capable of working this out for themselves?

Now on to an example port:

> +
> +.if defined(OPENSSL_RSAREF)
> +OPTLIB=		-L${OPENSSLLIB} -L${LOCALBASE} -lRSAglue -lrsaref
> +MAKE_ENV+=	OPTLIB="${OPTLIB}"
> +.endif
>  
>  .include <bsd.port.pre.mk>

This would have to look like this, with the bsd.port.mk patch moved up
into bsd.port.pre.mk:

 .include <bsd.port.pre.mk>
+
+.if defined(OPENSSL_RSAREF)
+OPTLIB=		-L${OPENSSLLIB} -L${LOCALBASE} -lRSAglue -lrsaref
+MAKE_ENV+=	OPTLIB="${OPTLIB}"
+.endif

> ++INCDIR=-I$(OPENSSLINC)/openssl -I$(PREFIX)/include

Why isn't OPENSSLINC=${OPENSSLBASE}/include/openssl?

> ++LIBDIR=-L$(OPENSSLLIB)/lib

LIBDIR=	-L${OPNSSLLIB}

All for now...  Otherwise it looks good.

Regards,
 -Jeremy

-- 
FreeBSD - Because the best things in life are free...
                                           http://www.freebsd.org/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000122230114.K10368>