r15998 - gnucash/trunk/packaging/win32 - Build OpenSSL 0.9.8e from tarball.

Andreas Köhler andi5 at cvs.gnucash.org
Thu Apr 26 13:17:43 EDT 2007


Author: andi5
Date: 2007-04-26 13:17:41 -0400 (Thu, 26 Apr 2007)
New Revision: 15998
Trac: http://svn.gnucash.org/trac/changeset/15998

Modified:
   gnucash/trunk/packaging/win32/defaults
   gnucash/trunk/packaging/win32/install.sh
Log:
Build OpenSSL 0.9.8e from tarball.

Also starring:
* Add mingw32-make, as openssl will be built in cmd.exe
* Link gwenhywfar against dynamic libraries (-leay32 -lssl32)
* Install svn before openssl to have the newer ssl dlls as first in PATH


Modified: gnucash/trunk/packaging/win32/defaults
===================================================================
--- gnucash/trunk/packaging/win32/defaults	2007-04-25 18:25:34 UTC (rev 15997)
+++ gnucash/trunk/packaging/win32/defaults	2007-04-26 17:17:41 UTC (rev 15998)
@@ -114,6 +114,7 @@
 set_default GCC_GPP_URL "$SF_MIRROR/mingw/gcc-g++-3.4.2-20040916-1.tar.gz"
 set_default MINGW_RT_URL "$SF_MIRROR/mingw/mingw-runtime-3.12.tar.gz"
 set_default W32API_URL "$SF_MIRROR/mingw/w32api-3.9.tar.gz"
+set_default MINGW_MAKE_URL "$SF_MIRROR/mingw/mingw32-make-3.81-2.tar.gz"
 set_default MINGW_DIR $GLOBAL_DIR\\mingw
 
 set_default UNZIP_URL "$SF_MIRROR/gnuwin32/unzip-5.51-1.exe"
@@ -140,8 +141,7 @@
 set_default SLIB_URL "http://swiss.csail.mit.edu/ftpdir/scm/OLD/slib3a3.zip"
 set_default GUILE_DIR $GLOBAL_DIR\\guile
 
-set_default OPENSSL_BIN_URL "$SF_MIRROR/gnuwin32/openssl-0.9.7c-bin.zip"
-set_default OPENSSL_LIB_URL "$SF_MIRROR/gnuwin32/openssl-0.9.7c-lib.zip"
+set_default OPENSSL_URL "http://www.openssl.org/source/openssl-0.9.8e.tar.gz"
 set_default OPENSSL_DIR $GLOBAL_DIR\\openssl
 
 set_default MINGW_UTILS_URL "$SF_MIRROR/mingw/mingw-utils-0.3.tar.gz"
@@ -280,6 +280,7 @@
 add_step inst_autotools
 add_step inst_guile
 if test x$cross_compile != xyes ; then
+ add_step inst_svn
  add_step inst_openssl
 fi
 add_step inst_mingwutils
@@ -303,7 +304,6 @@
  add_step inst_hh
 fi
 if test x$UPDATE_SOURCES = xyes ; then
- add_step inst_svn
  add_step svn_up
 fi
 add_step inst_gnucash

Modified: gnucash/trunk/packaging/win32/install.sh
===================================================================
--- gnucash/trunk/packaging/win32/install.sh	2007-04-25 18:25:34 UTC (rev 15997)
+++ gnucash/trunk/packaging/win32/install.sh	2007-04-26 17:17:41 UTC (rev 15998)
@@ -108,11 +108,18 @@
     quiet ${_MSYS_UDIR}/bin/perl --help || die "msys dtk not installed correctly"
 }
 
+function test_for_mingw() {
+    ${CC} --version &&
+    g++ --version &&
+    ${LD} --help &&
+    mingw32-make --help
+}
+
 function inst_mingw() {
     setup MinGW
     _MINGW_UDIR=`unix_path $MINGW_DIR`
     _MINGW_WFSDIR=`win_fs_path $MINGW_DIR`
-    if quiet ${CC} --version && quiet g++ --version && quiet ${LD} --help
+    if quiet test_for_mingw
     then
         echo "mingw already installed.  skipping."
     else
@@ -122,9 +129,10 @@
         wget_unpacked $GCC_GPP_URL $DOWNLOAD_DIR $MINGW_DIR
         wget_unpacked $MINGW_RT_URL $DOWNLOAD_DIR $MINGW_DIR
         wget_unpacked $W32API_URL $DOWNLOAD_DIR $MINGW_DIR
+        wget_unpacked $MINGW_MAKE_URL $DOWNLOAD_DIR $MINGW_DIR
         (echo "y"; echo "y"; echo "$_MINGW_WFSDIR") | sh pi.sh
     fi
-    quiet ${CC} --version && quiet g++ --version && quiet ${LD} --help || die "mingw not installed correctly"
+    quiet test_for_mingw || die "mingw not installed correctly"
 }
 
 function inst_unzip() {
@@ -178,6 +186,7 @@
 
 function inst_active_perl() {
     setup ActivePerl \(intltool\)
+    _ACTIVE_PERL_UDIR=`unix_path $ACTIVE_PERL_DIR`
     _ACTIVE_PERL_WFSDIR=`win_fs_path $ACTIVE_PERL_DIR`
     set_env_or_die $_ACTIVE_PERL_WFSDIR/ActivePerl/Perl/bin/perl INTLTOOL_PERL
     if quiet $INTLTOOL_PERL --help
@@ -312,6 +321,19 @@
     guile -c "(use-modules (ice-9 slib)) (require 'printf)" || die "guile not installed correctly"
 }
 
+function inst_svn() {
+    setup Subversion
+    _SVN_UDIR=`unix_path $SVN_DIR`
+    add_to_env $_SVN_UDIR/bin PATH
+    if quiet svn --version
+    then
+        echo "subversion already installed.  skipping."
+    else
+        smart_wget $SVN_URL $DOWNLOAD_DIR
+        $LAST_FILE //SP- //SILENT //DIR="$SVN_DIR"
+    fi
+}
+
 function inst_openssl() {
     setup OpenSSL
     _OPENSSL_UDIR=`unix_path $OPENSSL_DIR`
@@ -324,14 +346,34 @@
 	die "You have uninstalled the Win32OpenSSL-0_9_8d version of OpenSSL, but its DLLs libssl32.dll, libeay32.dll, and ssleay32.dll are still existing in $WINDIR\\system32. You have to delete (or rename) them manually. However, if you know these DLLs are needed by some other package, please contact the gnucash authors so that we can adapt this script."
     fi
 
-    if test -f ${_OPENSSL_UDIR}/lib/libssl.dll.a ; then
+    if quiet ${LD} -L$_OPENSSL_UDIR/lib -leay32 -lssl32 -o $TMP_UDIR/ofile ; then
         echo "openssl already installed.  skipping."
     else
-	mkdir -p ${_OPENSSL_UDIR}
-	wget_unpacked $OPENSSL_BIN_URL $DOWNLOAD_DIR $OPENSSL_DIR
-	wget_unpacked $OPENSSL_LIB_URL $DOWNLOAD_DIR $OPENSSL_DIR
+        smart_wget $OPENSSL_URL $DOWNLOAD_DIR
+        echo -n "Extracting ${LAST_FILE##*/} ... "
+        tar -xzpf $LAST_FILE -C $TMP_UDIR &>/dev/null | true
+        echo "done"
+        assert_one_dir $TMP_UDIR/openssl-*
+        qpushd $TMP_UDIR/openssl-*
+            for _dir in crypto ssl ; do
+                qpushd $_dir
+                    find . -name "*.h" -exec cp {} ../include/openssl/ \;
+                qpopd
+            done
+            cp *.h include/openssl
+            _COMSPEC_U=`unix_path $COMSPEC`
+            PATH=$_ACTIVE_PERL_UDIR/ActivePerl/Perl/bin:$_MINGW_UDIR/bin $_COMSPEC_U //c ms\\mingw32
+            mkdir -p $_OPENSSL_UDIR/bin
+            mkdir -p $_OPENSSL_UDIR/lib
+            mkdir -p $_OPENSSL_UDIR/include
+            cp -a libeay32.dll libssl32.dll $_OPENSSL_UDIR/bin
+            for _implib in libeay32 libssl32 ; do
+                cp -a out/$_implib.a $_OPENSSL_UDIR/lib/$_implib.dll.a
+            done
+            cp -a include/openssl $_OPENSSL_UDIR/include
+        qpopd
     fi
-    test -f ${_OPENSSL_UDIR}/lib/libssl.dll.a || die "openssl not installed correctly"
+    quiet ${LD} -L$_OPENSSL_UDIR/lib -leay32 -lssl32 -o $TMP_UDIR/ofile || die "openssl not installed correctly"
 }
 
 function inst_mingwutils() {
@@ -754,7 +796,7 @@
 	    ./configure \
 		--with-openssl-includes=$_OPENSSL_UDIR/include \
 		ssl_libraries="-L${_OPENSSL_UDIR}/lib" \
-		ssl_lib="-lcrypto -lssl" \
+		ssl_lib="-leay32 -lssl32" \
 	        --prefix=$_GWENHYWFAR_UDIR \
 	        CPPFLAGS="${REGEX_CPPFLAGS}" \
 		LDFLAGS="${REGEX_LDFLAGS}"
@@ -865,19 +907,6 @@
     ${PKG_CONFIG} --exists aqbanking || die "AqBanking not installed correctly"
 }
 
-function inst_svn() {
-    setup Subversion
-    _SVN_UDIR=`unix_path $SVN_DIR`
-    add_to_env $_SVN_UDIR/bin PATH
-    if quiet svn --version
-    then
-        echo "subversion already installed.  skipping."
-    else
-        smart_wget $SVN_URL $DOWNLOAD_DIR
-        $LAST_FILE //SP- //SILENT //DIR="$SVN_DIR"
-    fi
-}
-
 function svn_up() {
     mkdir -p $_REPOS_UDIR
     qpushd $REPOS_DIR



More information about the gnucash-changes mailing list