Subject: pkg/36517: builtin.mk fails to detect the Solaris built in OpenSSL
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <Lloyd.Parkes@ird.govt.nz>
List: pkgsrc-bugs
Date: 06/20/2007 08:15:00
>Number:         36517
>Category:       pkg
>Synopsis:       builtin.mk fails to detect the Solaris built in OpenSSL
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 20 08:15:00 +0000 2007
>Originator:     Lloyd Parkes
>Release:        N/A
>Organization:
Inland Revenue
>Environment:
SunOS xxx 5.10 Generic_118822-25 sun4u sparc SUNW,Ultra-5_10

>Description:
Sun's OpenSSL has support for the Sun crypto hardware, so it is necessary to use its OpenSSL libraries instead of the public version. Their software also seems to be better tuned than the public software, so using seems to be a good idea, even on systems without crypto acceleration.
>How-To-Repeat:
Build sysutils/cfengine2 and watch it try to compile OpenSSL.

>Fix:
See the patch at http://www.must-have-coffee.gen.nz/patches/builtin.mk.diff. It'll appear  there in a few hours.

I've tested this on Solaris 10, and sort-of on Solaris 9. I haven't had a chance to test it on NetBSD yet.

Here is a cut and paste copy of the patch (so whitespace will be off):
$NetBSD$

--- builtin.mk.orig     2007-02-23 08:27:08.000000000 +1300
+++ builtin.mk
@@ -4,7 +4,9 @@ BUILTIN_PKG:=   openssl
 
 BUILTIN_FIND_LIBS:=            des
 BUILTIN_FIND_FILES_VAR:=       H_OPENSSL
-BUILTIN_FIND_FILES.H_OPENSSL=  /usr/include/openssl/opensslv.h
+BUILTIN_FIND_FILES.H_OPENSSL=  /opt/SUNWconn/crypto/include/openssl/opensslv.h \
+                               /usr/sfw/include/openssl/opensslv.h \
+                               /usr/include/openssl/opensslv.h
 
 .include "../../mk/buildlink3/bsd.builtin.mk"
 
@@ -135,7 +137,10 @@ CHECK_BUILTIN.openssl?=    no
 .if !empty(CHECK_BUILTIN.openssl:M[nN][oO])
 
 .  if !empty(USE_BUILTIN.openssl:M[yY][eE][sS])
-BUILDLINK_PREFIX.openssl=      /usr
+BUILDLINK_PREFIX.openssl:=     ${H_OPENSSL:S-/include/openssl/opensslv.h--}
+.    if empty(BUILDLINK_PREFIX.openssl:M/usr)
+BUILDLINK_IS_DEPOT.openssl=    YES
+.    endif
 .  endif
 
 # By default, we don't bother with the old DES API.