[31959] trunk/dports/devel/openssl

mww at macports.org mww at macports.org
Wed Dec 12 10:52:42 PST 2007


Revision: 31959
          http://trac.macosforge.org/projects/macports/changeset/31959
Author:   mww at macports.org
Date:     2007-12-12 10:52:41 -0800 (Wed, 12 Dec 2007)

Log Message:
-----------
fix universal build, prepare 4-way universal build

Modified Paths:
--------------
    trunk/dports/devel/openssl/Portfile

Added Paths:
-----------
    trunk/dports/devel/openssl/files/patch-Configure

Modified: trunk/dports/devel/openssl/Portfile
===================================================================
--- trunk/dports/devel/openssl/Portfile	2007-12-12 18:30:58 UTC (rev 31958)
+++ trunk/dports/devel/openssl/Portfile	2007-12-12 18:52:41 UTC (rev 31959)
@@ -24,7 +24,7 @@
 depends_lib		port:zlib
 
 platform darwin {
-	patchfiles	patch-Makefile.org patch-crypto-Makefile
+	patchfiles	patch-Makefile.org patch-crypto-Makefile patch-Configure
 }
 
 configure.cmd	./config
@@ -34,10 +34,6 @@
 	depends_lib-append	port:dlcompat
 }
 
-platform darwin 8 {
-	build.args	CC=/usr/bin/gcc-4.0
-}
-
 variant rfc3779 {
 	configure.args-append	enable-rfc3779
 }
@@ -51,76 +47,97 @@
 livecheck.url	${master_sites}
 livecheck.regex	${name}-(0.9.8\[a-z\])
 
+#make 4-way universal build ready
 variant universal {
-    
-# port-specific procedure
-    proc clean {} {
-        system "make clean"
-        foreach f [glob lib*.a lib*.*.*.*.dylib] {
-            file delete ${f}
-        }
-    }
+	post-patch {
+#		foreach arch {i386 x86_64 ppc ppc64}
+		foreach arch {i386 ppc} {
+			file copy ${worksrcpath} ${workpath}/${arch}
+		}
+	}
 
-# i386
-    # configure
-    pre-configure {
-        system "./Configure darwin-i386-cc ${configure.pre_args} ${configure.args} && \
-		patch < ${filespath}/patch-Makefiles-universal-i386"
-        reinplace "s|^PROCESSOR=.*|PROCESSOR=|" ${worksrcpath}/Makefile
-    }
-    # build
-    configure {
-        system "make"
-    }
-    # backup, clean up
-    post-configure {
-        # get list of files to be backed up - only needs to be done once
-        fs-traverse file . {
-          if {![string equal [string range [file tail $file] end-1 end] .o]} {
-            set type [exec file -b $file]
-            if {[regexp {(Mach-O|ar archive)} $type]} {
-              global universal_filelist
-              lappend universal_filelist $file
-            }
-          }
-        }
+	configure {
+		foreach arch {i386 ppc} {
+			system "cd ${workpath}/${arch} && ./Configure darwin-${arch}-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}"
+	}
 
-        backup i386
+	build {
+#		foreach arch {i386 x86_64 ppc ppc64}
+		foreach arch {i386 ppc} {
+			system "cd ${workpath}/${arch} && make all"
+		}
+	}
 
-        clean
-    }
-# ppc
-    # configure
-    pre-build {
-        system "./Configure darwin-ppc-cc ${configure.pre_args} ${configure.args} && \
-		patch < ${filespath}/patch-Makefiles-universal-ppc"
-    }
-    # build
-    build {
-        system "make"
-    }
-    # backup
-    post-build {
-        # there's already a list of files to be backed up
+	destroot {
+# 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} {
+			xinstall -d ${workpath}/pre-dest/${arch}
+			system "cd ${workpath}/${arch} && make install INSTALL_PREFIX=${workpath}/pre-dest/${arch} MANDIR=${prefix}/share/man"
+		}
 
-        global fileList
+		set basepath "${workpath}/pre-dest/i386"
+		fs-traverse file "${basepath}" {
+			set fpath [string range "${file}" [string length "${basepath}"] [string length "${file}"]]
+			if {${fpath} != ""} {
+				ui_debug ":: ${fpath}"
 
-        backup ppc
+				switch -exact [file type "${basepath}${fpath}"] {
+					directory {
+						# just create directories
+						ui_debug "-- dir:: ${fpath}"
+						file mkdir "${destroot}${fpath}"
+					}
+					link {
+						# copy symlinks (TODO: check if target matches)
+						ui_debug "-- lnk:: ${fpath}"
+						file copy "${basepath}${fpath}" "${destroot}${fpath}"
+					}
+					file { 
+						# treat files depending on their filetype
+						ui_debug "-- file:: ${fpath}"
+						set filetype [exec "/usr/bin/file" "-b" "${basepath}${fpath}"]
+						switch -regexp ${filetype} {
+							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}"
+							}
+							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}"
+							}
+							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"
+								} else {
+									ui_debug "files match, just copying"
+									file copy "${basepath}${fpath}" "${destroot}${fpath}"
+								}
+							}
+						}
+					}
+					default { ui_debug "serious error" }
+				}
+			}
+		}
+	}
+}
 
-        clean
-    }
-
-# universal
-    pre-destroot {
-        global fileList
-        system "make openssl.pc libssl.pc libcrypto.pc"
-        lipo
-        system "patch < ${filespath}/patch-Makefile-universal-install"
-    }
-    destroot.target     install_docs install_sw
-
-    # the test suite can only be run *after* destrooting
-    test.run            yes
-    test.dir            ${worksrcpath}/test
-    test.target         alltests
-}
+# the test suite can only be run *after* destrooting
+#    test.run            yes
+#    test.dir            ${worksrcpath}/test
+#    test.target         alltests

Added: trunk/dports/devel/openssl/files/patch-Configure
===================================================================
--- trunk/dports/devel/openssl/files/patch-Configure	                        (rev 0)
+++ trunk/dports/devel/openssl/files/patch-Configure	2007-12-12 18:52:41 UTC (rev 31959)
@@ -0,0 +1,11 @@
+--- Configure	2007-09-16 14:24:17.000000000 +0200
++++ Configure	2007-12-12 14:12:25.000000000 +0100
+@@ -500,7 +500,7 @@
+ ##### MacOS X (a.k.a. Rhapsody or Darwin) setup
+ "rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::",
+ "darwin-ppc-cc","cc:-arch ppc -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::osx_ppc32.o::::::::::dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+-"darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:ppccpuid_osx64.o:osx_ppc64.o osx_ppc64-mont.o:::::sha1-ppc_osx64.o sha256-ppc_osx64.o sha512-ppc_osx64.o:::::::dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
++"darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:ppccpuid_osx64.o:osx_ppc64.o osx_ppc64-mont.o:::::sha1-ppc_osx64.o sha256-ppc_osx64.o sha512-ppc_osx64.o:::::dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+ "darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -fno-common::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+ "darwin64-x86_64-cc","cc:-arch x86_64 -O3 -fomit-frame-pointer -DL_ENDIAN -DMD32_REG_T=int -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+ "debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::osx_ppc32.o::::::::::dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071212/0bee2213/attachment.html


More information about the macports-changes mailing list