UniversalOpenssl: openssl.diff

File openssl.diff, 7.1 KB (added by pipping@…, 17 years ago)

patch to provide variant foo, building universal

  • files/patch-Makefiles-universal-ppc

     
     1--- Makefile.orig       2007-04-01 18:13:46.000000000 +0200
     2+++ Makefile    2007-04-01 18:15:07.000000000 +0200
     3@@ -60,7 +60,7 @@
     4 # PKCS1_CHECK - pkcs1 tests.
     5 
     6 CC= cc
     7-CFLAG= -fPIC -fno-common -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -O3 -DB_ENDIAN
     8+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
     9 DEPFLAG= -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_GMP -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779
     10 PEX_LIBS=
     11 EX_LIBS= -L/opt/local/lib  -lz
     12@@ -142,7 +142,7 @@
     13 SHARED_SSL=libssl$(SHLIB_EXT)
     14 SHARED_LIBS=$(SHARED_CRYPTO) $(SHARED_SSL)
     15 SHARED_LIBS_LINK_EXTS=.$(SHLIB_MAJOR).dylib .dylib
     16-SHARED_LDFLAGS=-dynamiclib
     17+SHARED_LDFLAGS=-dynamiclib -arch ppc
     18 
     19 GENERAL=        Makefile
     20 BASENAME=       openssl
     21--- Makefile.shared.orig        2007-04-01 18:16:24.000000000 +0200
     22+++ Makefile.shared     2007-04-01 18:16:55.000000000 +0200
     23@@ -11,8 +11,8 @@
     24 # LDFLAGS contains flags to be used when temporary object files (when building
     25 # shared libraries) are created, or when an application is linked.
     26 # SHARED_LDFLAGS contains flags to be used when the shared library is created.
     27-LDFLAGS=-arch i386
     28-SHARED_LDFLAGS=-arch i386
     29+LDFLAGS=-arch ppc
     30+SHARED_LDFLAGS=-arch ppc
     31 
     32 # LIBNAME contains just the name of the library, without prefix ("lib"
     33 # on Unix, "cyg" for certain forms under Cygwin...) or suffix (.a, .so,
  • files/patch-Makefile-universal-install

     
     1--- Makefile.orig       2007-04-02 05:42:04.000000000 +0200
     2+++ Makefile    2007-04-02 05:42:15.000000000 +0200
     3@@ -475,7 +475,7 @@
     4 dist_pem_h:
     5        (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean)
     6 
     7-install: all install_docs install_sw
     8+install: install_docs install_sw
     9 
     10 install_sw:
     11        @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
  • files/patch-Makefiles-universal-i386

     
     1--- Makefile.orig       2007-04-01 18:13:46.000000000 +0200
     2+++ Makefile    2007-04-01 18:15:07.000000000 +0200
     3@@ -60,7 +60,7 @@
     4 # PKCS1_CHECK - pkcs1 tests.
     5 
     6 CC= cc
     7-CFLAG= -fPIC -fno-common -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -O3 -fomit-frame-pointer -fno-common
     8+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
     9 DEPFLAG= -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_GMP -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779
     10 PEX_LIBS=
     11 EX_LIBS= -L/opt/local/lib  -lz
     12@@ -142,7 +142,7 @@
     13 SHARED_SSL=libssl$(SHLIB_EXT)
     14 SHARED_LIBS=$(SHARED_CRYPTO) $(SHARED_SSL)
     15 SHARED_LIBS_LINK_EXTS=.$(SHLIB_MAJOR).dylib .dylib
     16-SHARED_LDFLAGS=-dynamiclib
     17+SHARED_LDFLAGS=-dynamiclib -arch i386
     18 
     19 GENERAL=        Makefile
     20 BASENAME=       openssl
     21--- Makefile.shared.orig        2007-04-01 18:16:24.000000000 +0200
     22+++ Makefile.shared     2007-04-01 18:16:55.000000000 +0200
     23@@ -11,8 +11,8 @@
     24 # LDFLAGS contains flags to be used when temporary object files (when building
     25 # shared libraries) are created, or when an application is linked.
     26 # SHARED_LDFLAGS contains flags to be used when the shared library is created.
     27-LDFLAGS=
     28-SHARED_LDFLAGS=
     29+LDFLAGS=-arch i386
     30+SHARED_LDFLAGS=-arch i386
     31 
     32 # LIBNAME contains just the name of the library, without prefix ("lib"
     33 # on Unix, "cyg" for certain forms under Cygwin...) or suffix (.a, .so,
  • Portfile

     
    4646livecheck.check regex
    4747livecheck.url   ${master_sites}
    4848livecheck.regex ${name}-(0.9.8\[a-z\])
     49
     50variant foo {
     51   
     52# general procedures
     53    proc backup {arch} {
     54        global archList fileList workpath
     55        lappend archList ${arch}
     56        foreach fullPath ${fileList} {
     57            regexp {(.+/)([^/]+)} ./$fullPath dummy filePath fileName
     58            xinstall -d ${workpath}/${arch}/${filePath}
     59            xinstall ${fullPath} ${workpath}/${arch}/${filePath}
     60        }
     61    }
     62    proc lipo {} {
     63        global archList fileList workpath
     64        foreach fullPath ${fileList} {
     65            regexp {(.+/)([^/]+)} ./$fullPath dummy filePath fileName
     66            xinstall -d ${filePath}
     67            file delete ${fullPath}
     68            set lipoSources ""
     69            foreach a $archList {
     70                append lipoSources "-arch ${a} ${workpath}/${a}/${fullPath} "
     71            }
     72            system "lipo ${lipoSources}-create -output ${fullPath}"
     73        }
     74    }
     75
     76# special procedure
     77    proc clean {} {
     78        system "make clean"
     79        foreach f [glob lib*.a lib*.*.*.*.dylib] {
     80            file delete ${f}
     81        }
     82    }
     83
     84# i386
     85    # configure
     86    pre-configure {
     87        cd ${worksrcpath}
     88        system "./Configure darwin-i386-cc ${configure.pre_args} ${configure.args}"
     89        system "patch < ${filespath}/patch-Makefiles-universal-i386"
     90        reinplace "s|^PROCESSOR=.*|PROCESSOR=|" Makefile
     91    }
     92    # build
     93    configure {
     94        cd ${worksrcpath}
     95        system "make"
     96    }
     97    # backup, clean up
     98    post-configure {
     99        cd ${worksrcpath}
     100        # get list of files to be backed up - only needs to be done once
     101        set binList     "apps/openssl"
     102        set enList      [glob engines/*.so]
     103        set libList     [glob lib*.a lib*.*.*.*.dylib]
     104        set testList    [concat test/sha256t test/sha512t [glob test/*test]]
     105
     106        global fileList
     107        set fileList    [concat $binList $enList $libList $testList]
     108
     109        backup i386
     110
     111        clean
     112    }
     113# ppc
     114    # configure
     115    pre-build {
     116        cd ${worksrcpath}
     117        system "./Configure darwin-ppc-cc ${configure.pre_args} ${configure.args}"
     118        system "patch < ${filespath}/patch-Makefiles-universal-ppc"
     119    }
     120    # build
     121    build {
     122        cd ${worksrcpath}
     123        system "make"
     124    }
     125    # backup
     126    post-build {
     127        cd ${worksrcpath}
     128        # there's already a list of files to be backed up
     129
     130        global fileList
     131
     132        backup ppc
     133
     134        clean
     135    }
     136
     137# universal
     138    pre-destroot {
     139        cd ${worksrcpath}
     140        global fileList
     141        system "make openssl.pc libssl.pc libcrypto.pc"
     142        lipo
     143        system "patch < ${filespath}/patch-Makefile-universal-install"
     144    }
     145    destroot.target     install_docs install_sw
     146
     147    # the test suite can only be run *after* destrooting
     148    test.run            yes
     149    test.dir            ${worksrcpath}/test
     150    test.target         alltests
     151}