[41928] trunk/dports/devel/openssl
jmr at macports.org
jmr at macports.org
Wed Nov 12 01:05:28 PST 2008
Revision: 41928
http://trac.macports.org/changeset/41928
Author: jmr at macports.org
Date: 2008-11-12 01:05:28 -0800 (Wed, 12 Nov 2008)
Log Message:
-----------
openssl: support building universal with 64-bit archs, and respect universal_archs (#15033, maintainer timeout)
Modified Paths:
--------------
trunk/dports/devel/openssl/Portfile
Added Paths:
-----------
trunk/dports/devel/openssl/files/patch-opensslconf.h-32.diff
trunk/dports/devel/openssl/files/patch-opensslconf.h-ppc64.diff
trunk/dports/devel/openssl/files/patch-opensslconf.h-x86_64.diff
Removed Paths:
-------------
trunk/dports/devel/openssl/files/patch-Makefile-universal-install
trunk/dports/devel/openssl/files/patch-Makefiles-universal-i386
trunk/dports/devel/openssl/files/patch-Makefiles-universal-ppc
Modified: trunk/dports/devel/openssl/Portfile
===================================================================
--- trunk/dports/devel/openssl/Portfile 2008-11-12 09:04:45 UTC (rev 41927)
+++ trunk/dports/devel/openssl/Portfile 2008-11-12 09:05:28 UTC (rev 41928)
@@ -50,26 +50,40 @@
livecheck.url ${master_sites}
livecheck.regex ${name}-(0.9.8\[a-z\])
-#make 4-way universal build ready
+if { ![info exists universal_archs] } {
+ set universal_archs {i386 ppc}
+ #set universal_archs {i386 x86_64 ppc ppc64}
+}
+set first_arch [lindex ${universal_archs} 0]
+
variant universal {
post-patch {
-# foreach arch {i386 x86_64 ppc ppc64}
- foreach arch {i386 ppc} {
- file copy ${worksrcpath} ${workpath}/${arch}
+ foreach arch ${universal_archs} {
+ if {[string equal ${arch} ${first_arch}]} {
+ move ${worksrcpath} ${workpath}/${first_arch}
+ } else {
+ copy ${workpath}/${first_arch} ${workpath}/${arch}
+ }
}
}
configure {
- foreach arch {i386 ppc} {
- system "cd ${workpath}/${arch} && ./Configure darwin-${arch}-cc ${configure.pre_args} ${configure.args}"
+ foreach arch ${universal_archs} {
+ if { [string first 64 $arch] == -1 } {
+ set my_cc "darwin-${arch}-cc"
+ } else {
+ if {[string first ppc $arch] != -1} {
+ set my_cc "darwin64-ppc-cc"
+ } else {
+ set my_cc "darwin64-${arch}-cc"
+ }
+ }
+ system "cd ${workpath}/${arch} && ./Configure ${my_cc} ${configure.pre_args} ${configure.args}"
}
-# system "cd ${workpath}/x86_64 && ./Configure darwin64-x86_64-cc ${configure.pre_args} ${configure.args}"
-# system "cd ${workpath}/ppc64 && ./Configure darwin64-ppc-cc ${configure.pre_args} ${configure.args}"
}
build {
-# foreach arch {i386 x86_64 ppc ppc64}
- foreach arch {i386 ppc} {
+ foreach arch ${universal_archs} {
system "cd ${workpath}/${arch} && make all"
}
}
@@ -78,10 +92,21 @@
# in port 1.7, just call:
# merge "${workpath}/pre-dest"
# till then, do this:
-# foreach arch {i386 x86_64 ppc ppc64}
- foreach arch {i386 ppc} {
+ foreach arch ${universal_archs} {
xinstall -d ${workpath}/pre-dest/${arch}
system "cd ${workpath}/${arch} && make install INSTALL_PREFIX=${workpath}/pre-dest/${arch} MANDIR=${prefix}/share/man"
+
+ # opensslconf.h will differ between 32- and 64-bit, so patch it so it doesn't
+ if { [string first 64 $arch] != -1 } {
+ if { [string first ppc $arch] != -1 } {
+ set configpatch ${filespath}/patch-opensslconf.h-ppc64.diff
+ } else {
+ set configpatch ${filespath}/patch-opensslconf.h-x86_64.diff
+ }
+ } else {
+ set configpatch ${filespath}/patch-opensslconf.h-32.diff
+ }
+ system "cd ${workpath}/pre-dest/${arch}${prefix} && patch --no-backup-if-mismatch -p0 < ${configpatch}"
}
set basepath "${workpath}/pre-dest/i386"
@@ -109,23 +134,38 @@
Mach-O.* {
# Mach-O binaries get lipo-ed
ui_debug "Mach-O file -- lipo-ing"
-# system "lipo -arch i386 ${workpath}/pre-dest/i386/${fpath} -arch x86_64 ${workpath}/pre-dest/x86_64/${fpath} -arch ppc ${workpath}/pre-dest/ppc/${fpath} -arch ppc64 ${workpath}/pre-dest/ppc64/${fpath} -create -output ${destroot}${fpath}"
- system "lipo -arch i386 ${workpath}/pre-dest/i386/${fpath} -arch ppc ${workpath}/pre-dest/ppc/${fpath} -create -output ${destroot}${fpath}"
+ set machocmd "lipo"
+ foreach arch ${universal_archs} {
+ set machocmd "${machocmd} -arch $arch ${workpath}/pre-dest/${arch}/${fpath}"
+ }
+ set machocmd "${machocmd} -create -output ${destroot}${fpath}"
+ system ${machocmd}
}
current\ ar\ archive {
# ar archives get lipo-ed
ui_debug "ar archive -- lipo-ing"
-# system "lipo -arch i386 ${workpath}/pre-dest/i386/${fpath} -arch x86_64 ${workpath}/pre-dest/x86_64/${fpath} -arch ppc ${workpath}/pre-dest/ppc/${fpath} -arch ppc64 ${workpath}/pre-dest/ppc64/${fpath} -create -output ${destroot}${fpath}"
- system "lipo -arch i386 ${workpath}/pre-dest/i386/${fpath} -arch ppc ${workpath}/pre-dest/ppc/${fpath} -create -output ${destroot}${fpath}"
+ set arcmd "lipo"
+ foreach arch ${universal_archs} {
+ set arcmd "${arcmd} -arch $arch ${workpath}/pre-dest/${arch}/${fpath}"
+ }
+ set arcmd "${arcmd} -create -output ${destroot}${fpath}"
+ system ${arcmd}
}
default {
# unknown file types are copied IF they do not differ across ALL architectures -- if they do: This is an error!
ui_debug "unknown filetype: ${filetype}"
- set differ1 [exec "/usr/bin/diff" "-q" "${workpath}/pre-dest/i386/${fpath}" "${workpath}/pre-dest/ppc/${fpath}"]
-# set differ2 [exec "/usr/bin/diff" "-q" "${workpath}/pre-dest/i386/${fpath}" "${workpath}/pre-dest/x86_64/${fpath}"]
-# set differ3 [exec "/usr/bin/diff" "-q" "${workpath}/pre-dest/i386/${fpath}" "${workpath}/pre-dest/ppc64/${fpath}"]
- if {${differ1} != ""} {
- ui_debug "ERROR"
+
+ set any_difference no
+ foreach arch ${universal_archs} {
+ if {![string equal ${arch} ${first_arch}]} {
+ set differ1 [exec "/usr/bin/diff" "-q" "${workpath}/pre-dest/${first_arch}/${fpath}" "${workpath}/pre-dest/${arch}/${fpath}"]
+ if {![string equal ${differ1} ""]} {
+ set any_difference yes
+ }
+ }
+ }
+ if {${any_difference}} {
+ ui_debug "ERROR: files differ"
} else {
ui_debug "files match, just copying"
file copy "${basepath}${fpath}" "${destroot}${fpath}"
Deleted: trunk/dports/devel/openssl/files/patch-Makefile-universal-install
===================================================================
--- trunk/dports/devel/openssl/files/patch-Makefile-universal-install 2008-11-12 09:04:45 UTC (rev 41927)
+++ trunk/dports/devel/openssl/files/patch-Makefile-universal-install 2008-11-12 09:05:28 UTC (rev 41928)
@@ -1,11 +0,0 @@
---- Makefile.orig 2007-04-02 05:42:04.000000000 +0200
-+++ Makefile 2007-04-02 05:42:15.000000000 +0200
-@@ -475,7 +475,7 @@
- dist_pem_h:
- (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean)
-
--install: all install_docs install_sw
-+install: install_docs install_sw
-
- install_sw:
- @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
Deleted: trunk/dports/devel/openssl/files/patch-Makefiles-universal-i386
===================================================================
--- trunk/dports/devel/openssl/files/patch-Makefiles-universal-i386 2008-11-12 09:04:45 UTC (rev 41927)
+++ trunk/dports/devel/openssl/files/patch-Makefiles-universal-i386 2008-11-12 09:05:28 UTC (rev 41928)
@@ -1,33 +0,0 @@
---- Makefile.orig 2007-04-01 18:13:46.000000000 +0200
-+++ Makefile 2007-04-01 18:15:07.000000000 +0200
-@@ -60,7 +60,7 @@
- # PKCS1_CHECK - pkcs1 tests.
-
- CC= cc
--CFLAG= -fPIC -fno-common -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -O3 -fomit-frame-pointer -fno-common
-+CFLAG= -fPIC -fno-common -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -O3 -fomit-frame-pointer -fno-common -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386
- DEPFLAG= -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_GMP -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779
- PEX_LIBS=
- EX_LIBS= -L/opt/local/lib -lz
-@@ -142,7 +142,7 @@
- SHARED_SSL=libssl$(SHLIB_EXT)
- SHARED_LIBS=$(SHARED_CRYPTO) $(SHARED_SSL)
- SHARED_LIBS_LINK_EXTS=.$(SHLIB_MAJOR).dylib .dylib
--SHARED_LDFLAGS=-dynamiclib
-+SHARED_LDFLAGS=-dynamiclib -arch i386
-
- GENERAL= Makefile
- BASENAME= openssl
---- Makefile.shared.orig 2007-04-01 18:16:24.000000000 +0200
-+++ Makefile.shared 2007-04-01 18:16:55.000000000 +0200
-@@ -11,8 +11,8 @@
- # LDFLAGS contains flags to be used when temporary object files (when building
- # shared libraries) are created, or when an application is linked.
- # SHARED_LDFLAGS contains flags to be used when the shared library is created.
--LDFLAGS=
--SHARED_LDFLAGS=
-+LDFLAGS=-arch i386
-+SHARED_LDFLAGS=-arch i386
-
- # LIBNAME contains just the name of the library, without prefix ("lib"
- # on Unix, "cyg" for certain forms under Cygwin...) or suffix (.a, .so,
Deleted: trunk/dports/devel/openssl/files/patch-Makefiles-universal-ppc
===================================================================
--- trunk/dports/devel/openssl/files/patch-Makefiles-universal-ppc 2008-11-12 09:04:45 UTC (rev 41927)
+++ trunk/dports/devel/openssl/files/patch-Makefiles-universal-ppc 2008-11-12 09:05:28 UTC (rev 41928)
@@ -1,33 +0,0 @@
---- Makefile.orig 2007-04-01 18:13:46.000000000 +0200
-+++ Makefile 2007-04-01 18:15:07.000000000 +0200
-@@ -60,7 +60,7 @@
- # PKCS1_CHECK - pkcs1 tests.
-
- CC= cc
--CFLAG= -fPIC -fno-common -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -O3 -DB_ENDIAN
-+CFLAG= -fPIC -fno-common -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -O3 -DB_ENDIAN -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc
- DEPFLAG= -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_GMP -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779
- PEX_LIBS=
- EX_LIBS= -L/opt/local/lib -lz
-@@ -142,7 +142,7 @@
- SHARED_SSL=libssl$(SHLIB_EXT)
- SHARED_LIBS=$(SHARED_CRYPTO) $(SHARED_SSL)
- SHARED_LIBS_LINK_EXTS=.$(SHLIB_MAJOR).dylib .dylib
--SHARED_LDFLAGS=-dynamiclib
-+SHARED_LDFLAGS=-dynamiclib -arch ppc
-
- GENERAL= Makefile
- BASENAME= openssl
---- Makefile.shared.orig 2007-04-01 18:16:24.000000000 +0200
-+++ Makefile.shared 2007-04-01 18:16:55.000000000 +0200
-@@ -11,8 +11,8 @@
- # LDFLAGS contains flags to be used when temporary object files (when building
- # shared libraries) are created, or when an application is linked.
- # SHARED_LDFLAGS contains flags to be used when the shared library is created.
--LDFLAGS=-arch i386
--SHARED_LDFLAGS=-arch i386
-+LDFLAGS=-arch ppc
-+SHARED_LDFLAGS=-arch ppc
-
- # LIBNAME contains just the name of the library, without prefix ("lib"
- # on Unix, "cyg" for certain forms under Cygwin...) or suffix (.a, .so,
Added: trunk/dports/devel/openssl/files/patch-opensslconf.h-32.diff
===================================================================
--- trunk/dports/devel/openssl/files/patch-opensslconf.h-32.diff (rev 0)
+++ trunk/dports/devel/openssl/files/patch-opensslconf.h-32.diff 2008-11-12 09:05:28 UTC (rev 41928)
@@ -0,0 +1,54 @@
+--- include/openssl/opensslconf.h.orig 2008-04-17 21:20:15.000000000 +1000
++++ include/openssl/opensslconf.h 2008-04-17 21:37:29.000000000 +1000
+@@ -134,13 +134,21 @@
+ /* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
+ * %20 speed up (longs are 8 bytes, int's are 4). */
+ #ifndef DES_LONG
++#if defined(__x86_64__)
++#define DES_LONG unsigned int
++#else
+ #define DES_LONG unsigned long
+ #endif
+ #endif
++#endif
+
+ #if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
+ #define CONFIG_HEADER_BN_H
++#if defined(__ppc64__) || defined(__x86_64__)
++#undef BN_LLONG
++#else
+ #define BN_LLONG
++#endif
+
+ /* Should we define BN_DIV2W here? */
+
+@@ -148,9 +156,17 @@
+ /* The prime number generation stuff may not work when
+ * EIGHT_BIT but I don't care since I've only used this mode
+ * for debuging the bignum libraries */
++#if defined(__ppc64__) || defined(__x86_64__)
++#define SIXTY_FOUR_BIT_LONG
++#else
+ #undef SIXTY_FOUR_BIT_LONG
++#endif
+ #undef SIXTY_FOUR_BIT
++#if defined(__ppc64__) || defined(__x86_64__)
++#undef THIRTY_TWO_BIT
++#else
+ #define THIRTY_TWO_BIT
++#endif
+ #undef SIXTEEN_BIT
+ #undef EIGHT_BIT
+ #endif
+@@ -164,7 +180,11 @@
+
+ #if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
+ #define CONFIG_HEADER_BF_LOCL_H
++#if defined(__x86_64__)
++#define BF_PTR2
++#else
+ #define BF_PTR
++#endif
+ #endif /* HEADER_BF_LOCL_H */
+
+ #if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H)
Added: trunk/dports/devel/openssl/files/patch-opensslconf.h-ppc64.diff
===================================================================
--- trunk/dports/devel/openssl/files/patch-opensslconf.h-ppc64.diff (rev 0)
+++ trunk/dports/devel/openssl/files/patch-opensslconf.h-ppc64.diff 2008-11-12 09:05:28 UTC (rev 41928)
@@ -0,0 +1,54 @@
+--- include/openssl/opensslconf.h.orig 2008-04-17 21:20:44.000000000 +1000
++++ include/openssl/opensslconf.h 2008-04-17 21:37:33.000000000 +1000
+@@ -134,13 +134,21 @@
+ /* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
+ * %20 speed up (longs are 8 bytes, int's are 4). */
+ #ifndef DES_LONG
++#if defined(__x86_64__)
++#define DES_LONG unsigned int
++#else
+ #define DES_LONG unsigned long
++#endif
+ #endif
+ #endif
+
+ #if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
+ #define CONFIG_HEADER_BN_H
++#if defined(__ppc64__) || defined(__x86_64__)
+ #undef BN_LLONG
++#else
++#define BN_LLONG
++#endif
+
+ /* Should we define BN_DIV2W here? */
+
+@@ -148,9 +156,17 @@
+ /* The prime number generation stuff may not work when
+ * EIGHT_BIT but I don't care since I've only used this mode
+ * for debuging the bignum libraries */
++#if defined(__ppc64__) || defined(__x86_64__)
+ #define SIXTY_FOUR_BIT_LONG
++#else
++#undef SIXTY_FOUR_BIT_LONG
++#endif
+ #undef SIXTY_FOUR_BIT
++#if defined(__ppc64__) || defined(__x86_64__)
+ #undef THIRTY_TWO_BIT
++#else
++#define THIRTY_TWO_BIT
++#endif
+ #undef SIXTEEN_BIT
+ #undef EIGHT_BIT
+ #endif
+@@ -164,7 +180,11 @@
+
+ #if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
+ #define CONFIG_HEADER_BF_LOCL_H
++#if defined(__x86_64__)
++#define BF_PTR2
++#else
+ #define BF_PTR
++#endif
+ #endif /* HEADER_BF_LOCL_H */
+
+ #if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H)
Added: trunk/dports/devel/openssl/files/patch-opensslconf.h-x86_64.diff
===================================================================
--- trunk/dports/devel/openssl/files/patch-opensslconf.h-x86_64.diff (rev 0)
+++ trunk/dports/devel/openssl/files/patch-opensslconf.h-x86_64.diff 2008-11-12 09:05:28 UTC (rev 41928)
@@ -0,0 +1,54 @@
+--- include/openssl/opensslconf.h.orig 2008-04-17 21:20:44.000000000 +1000
++++ include/openssl/opensslconf.h 2008-04-17 21:37:33.000000000 +1000
+@@ -134,13 +134,21 @@
+ /* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
+ * %20 speed up (longs are 8 bytes, int's are 4). */
+ #ifndef DES_LONG
++#if defined(__x86_64__)
+ #define DES_LONG unsigned int
++#else
++#define DES_LONG unsigned long
++#endif
+ #endif
+ #endif
+
+ #if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
+ #define CONFIG_HEADER_BN_H
++#if defined(__ppc64__) || defined(__x86_64__)
+ #undef BN_LLONG
++#else
++#define BN_LLONG
++#endif
+
+ /* Should we define BN_DIV2W here? */
+
+@@ -148,9 +156,17 @@
+ /* The prime number generation stuff may not work when
+ * EIGHT_BIT but I don't care since I've only used this mode
+ * for debuging the bignum libraries */
++#if defined(__ppc64__) || defined(__x86_64__)
+ #define SIXTY_FOUR_BIT_LONG
++#else
++#undef SIXTY_FOUR_BIT_LONG
++#endif
+ #undef SIXTY_FOUR_BIT
++#if defined(__ppc64__) || defined(__x86_64__)
+ #undef THIRTY_TWO_BIT
++#else
++#define THIRTY_TWO_BIT
++#endif
+ #undef SIXTEEN_BIT
+ #undef EIGHT_BIT
+ #endif
+@@ -164,7 +180,11 @@
+
+ #if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
+ #define CONFIG_HEADER_BF_LOCL_H
++#if defined(__x86_64__)
+ #define BF_PTR2
++#else
++#define BF_PTR
++#endif
+ #endif /* HEADER_BF_LOCL_H */
+
+ #if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20081112/235f68f5/attachment-0001.html>
More information about the macports-changes
mailing list