Subject: pkg/32491: [Solaris] openssl on i386_x64 failed to compile
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <raczkow@prz.edu.pl>
List: pkgsrc-bugs
Date: 01/10/2006 14:25:00
>Number:         32491
>Category:       pkg
>Synopsis:       [Solaris] openssl on i386_x64 failed to compile
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          support
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 10 14:25:00 +0000 2006
>Originator:     Krzysztof Raczkowski
>Release:        
>Organization:
Rzeszow University of Technology, Poland
>Environment:
SunOS pkgsrc-i64 5.10 Generic_118844-20 i86pc i386 i86pc
>Description:
I'm using Solaris 10 on i386_x64 machine with Sun Studio 11 compiler.
When I'm trying to build openssl with 64 bit support, compilation fails with following error:

cd /usr/pkgsrc/security/openssl/work.pkgsrc-i64/openssl-0.9.7i && /usr/pkg/bin/perl util/perlpath.pl /usr/pkg/bin/perl
Operating system: i86pc-whatever-solaris2
This system (solaris64-x86_64-sc3) is not supported. See file INSTALL for details.
===> Building for openssl-0.9.7i
Makefile is older than Makefile.org.
Reconfigure the source tree (via './config' or 'perl Configure'), please.
gmake: *** [Makefile] Error 255
*** Error code 2

The problem is with CONFIGURE_ARGS variable in Makefile, which doesn't get proper value (solaris64-x86_64-cc in my case).


>How-To-Repeat:
mk.conf:
ABI=64
PKGSRC_COMPILER=        sunpro
CFLAGS+= -xtarget=pentium4 -xarch=amd64

cd /usr/pkgsrc/security/openssl
bmake

>Fix:
I created this patch, which is a little nasty hack. I'm a newbe in pkgsrc Makefile editing, so you should modify it to use solaris64-x86_64-gcc (or solaris64-x86_64-cc) only if 64 bit ABI is set. I don't know why i couldn't use ${ABI} == "64" in .elif expression. 


#----BEGIN-----
--- Makefile.orig       2006-01-10 14:05:58.000000000 +0100
+++ Makefile    2006-01-10 14:35:40.000000000 +0100
@@ -48,12 +48,20 @@
 CONFIGURE_ARGS+=       --openssldir=${PKG_SYSCONFDIR:Q}
 CONFIGURE_ARGS+=       shared

-.if ${OPSYS} == "SunOS" && ${MACHINE_ARCH} == "sparc"
+.if ${OPSYS} == "SunOS"
 CONFIGURE_SCRIPT=      ./Configure
-.  if !empty(CC_VERSION:Mgcc*)
+.  if ${MACHINE_ARCH} == "sparc"
+.    if !empty(CC_VERSION:Mgcc*)
 CONFIGURE_ARGS+=       solaris-${SPARC_TARGET_ARCH}-gcc
-.  else
+.    else
 CONFIGURE_ARGS+=       solaris-${SPARC_TARGET_ARCH}-cc
+.    endif
+.  elif ${MACHINE_ARCH} == "i386"
+.    if !empty(CC_VERSION:Mgcc*)
+CONFIGURE_ARGS+=       solaris64-x86_64-gcc
+.    else
+CONFIGURE_ARGS+=       solaris64-x86_64-cc
+.    endif
 .  endif
 .elif ${OPSYS} == "IRIX"
 CONFIGURE_ARGS+=       no-asm
#----END-----