[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r19664: {torvm} Cleanup mingw32 build environment, transition Tor sources to (in torvm/trunk/build/win32: . files)



Author: coderman
Date: 2009-06-08 18:24:11 -0400 (Mon, 08 Jun 2009)
New Revision: 19664

Modified:
   torvm/trunk/build/win32/Makefile
   torvm/trunk/build/win32/files/buildall.sh
   torvm/trunk/build/win32/files/install.bat
Log:
Cleanup mingw32 build environment, transition Tor sources to Git from Subversion.

Modified: torvm/trunk/build/win32/Makefile
===================================================================
--- torvm/trunk/build/win32/Makefile	2009-06-08 19:18:44 UTC (rev 19663)
+++ torvm/trunk/build/win32/Makefile	2009-06-08 22:24:11 UTC (rev 19664)
@@ -228,11 +228,10 @@
 VIDALIA_VER=3730
 
 # for package resources
-TORSVN_NAME=tor-latest
-TORSVN_TGZ=$(TORSVN_NAME).tar.gz
-TORSVN_SVN=https://tor-svn.freehaven.net/svn/tor/
-TORSVN_BR=trunk
-TORSVN_VER=19114
+TORSRC_NAME=tor-latest
+TORSRC_TGZ=$(TORSRC_NAME).tar.gz
+TORSRC_GIT=git://git.torproject.org/git/tor
+TORSRC_VER=358efe1eea9be4c0e1c5e0e5e90dfb2cb0e24235
 
 TORBUTTON_NAME=torbutton-latest
 TORBUTTON_TGZ=$(TORBUTTON_NAME).tar.gz
@@ -313,7 +312,8 @@
 	@if [ ! -e $(WDLDIR)/$(QEMU_F) ]; then $(DLCMD) "$(QEMU_URL)" $(QEMU_SUM) "$(WDLDIR)/$(QEMU_F)"; fi
 	@if [ ! -e $(WDLDIR)/$(TORBUTTON_XPI_F) ]; then $(DLCMD) "$(TORBUTTON_XPI_URL)" $(TORBUTTON_XPI_SUM) "$(WDLDIR)/$(TORBUTTON_XPI_F)"; fi
 	@$(SEVNZIP_OPT_DL); $(OK)
-	@( export ddir=`pwd`/iso; if [ ! -f $ddir ]; then export ddir="$(ISODIR)"; fi; cd $(SDLDIR); if [ -d $(TORSVN_NAME) ]; then cd $(TORSVN_NAME); $(SVNCMD) up; $(OK); else $(SVNCMD) co "$(TORSVN_SVN)$(TORSVN_BR)" $(TORSVN_NAME) ; fi )
+	@( cd $(SDLDIR); if [ -d $(TORSRC_NAME) ]; then if [ ! -d $(TORSRC_NAME)/.git ]; then rm -rf $(TORSRC_NAME); fi; $(OK); fi )
+	@( cd $(SDLDIR); if [ -d $(TORSRC_NAME) ]; then cd $(TORSRC_NAME); $(GITCMD) pull; $(OK); else $(GITCMD) clone $(TORSRC_GIT) $(TORSRC_NAME); fi )
 	@( cd $(SDLDIR); if [ -d $(TORBUTTON_NAME) ]; then cd $(TORBUTTON_NAME); $(SVNCMD) up; $(OK); else $(SVNCMD) co "$(TORBUTTON_SVN)$(TORBUTTON_BR)" $(TORBUTTON_NAME) ; fi )
 	@( cd $(SDLDIR); if [ -d $(VIDALIA_NAME) ]; then cd $(VIDALIA_NAME); $(SVNCMD) up; $(OK); else $(SVNCMD) co "$(VIDALIA_SVN)$(VIDALIA_BR)" $(VIDALIA_NAME) ; fi )
 	@( cd $(SDLDIR); if [ -d $(MARBLE_NAME) ]; then cd $(MARBLE_NAME); $(SVNCMD) up; $(OK); else $(SVNCMD) co "$(MARBLE_SVN)$(MARBLE_BR)" $(MARBLE_NAME) ; fi )
@@ -362,13 +362,11 @@
 	cp files/buildall.sh $(ISODIR)/dl/src; \
 	cp patches/* $(ISODIR)/dl/src; \
 	cp $(addprefix $(WDLDIR)/, $(ALLFILES)) $(ISODIR)/dl/; \
+	tar zxf $(WDLDIR)/$(MINGWRUN_F) bin; mv bin/* $(ISODIR)/bin/;rmdir bin; \
+	$(UNZIP) $(WDLDIR)/$(LIBARCH_F) -d $(ISODIR)/ bin/bsdtar.exe bin/libarchive2.dll; \
 	$(UNZIP) $(WDLDIR)/$(ZLIB_F) -d $(ISODIR)/; \
 	$(UNZIP) $(WDLDIR)/$(GZIP_F) -d $(ISODIR)/; \
 	$(UNZIP) $(WDLDIR)/$(BZIP2_F) -d $(ISODIR)/; \
-	tar zxf $(WDLDIR)/$(MINGWRUN_F) bin; mv bin/* $(ISODIR)/bin/;rmdir bin; \
-	tar zxf $(WDLDIR)/$(MSYSCORE_F) ./bin; mv bin/* $(ISODIR)/bin/;rmdir bin; \
-	tar jxf $(WDLDIR)/$(MSYSZLIB_F) bin/msys-z.dll; mv bin/* $(ISODIR)/bin/;rmdir bin; \
-	$(UNZIP) $(WDLDIR)/$(LIBARCH_F) -d $(ISODIR)/ bin/bsdtar.exe bin/libarchive2.dll; \
 	mv $(ISODIR)/dl/$(PTHREADS_F) $(ISODIR)/dl/src/; \
 	mv $(ISODIR)/dl/$(QEMU_F) $(ISODIR)/dl/src/; \
 	mv $(ISODIR)/dl/$(GROFF_F) $(ISODIR)/dl/src/; \
@@ -403,9 +401,10 @@
 	rm -rf $(THANDY_NAME); $(GITCMD) clone $(LOCALGITOPTS) $(SDLDIR)/$(THANDY_NAME) $(THANDY_NAME) ; \
 	( cd $(THANDY_NAME); $(GITCMD) checkout $(THANDY_VER); ); \
 	tar zcf $(ISODIR)/dl/src/$(THANDY_TGZ) $(THANDY_NAME); rm -rf $(THANDY_NAME); \
-	echo "--- Exporting Tor version $(TORSVN_VER) from local mirror ..."; \
-	rm -rf $(TORSVN_NAME); $(SVNCMD) export --revision $(TORSVN_VER) $(SDLDIR)/$(TORSVN_NAME) $(TORSVN_NAME) ; \
-	tar zcf $(ISODIR)/dl/src/$(TORSVN_TGZ) $(TORSVN_NAME); rm -rf $(TORSVN_NAME); \
+	echo "--- Exporting Tor version $(TORSRC_VER) from local mirror ..."; \
+	rm -rf $(TORSRC_NAME); $(GITCMD) clone $(LOCALGITOPTS) $(SDLDIR)/$(TORSRC_NAME) $(TORSRC_NAME) ; \
+	( cd $(TORSRC_NAME); $(GITCMD) checkout $(TORSRC_VER); ); \
+	tar zcf $(ISODIR)/dl/src/$(TORSRC_TGZ) $(TORSRC_NAME); rm -rf $(TORSRC_NAME); \
 	echo "--- Exporting PyCrypto version $(PYCRYPTO_VER) from local mirror ..."; \
 	rm -rf $(PYCRYPTO_NAME); $(GITCMD) clone $(LOCALGITOPTS) $(SDLDIR)/$(PYCRYPTO_NAME) $(PYCRYPTO_NAME) ; \
 	( cd $(PYCRYPTO_NAME); $(GITCMD) checkout $(PYCRYPTO_VER); ); \
@@ -417,7 +416,7 @@
 		echo "--- Exporting and archiving Tor Button version $(TORBUTTON_VER) from local mirror ..."; \
 		rm -rf $(TORBUTTON_NAME); $(SVNCMD) export --revision $(TORBUTTON_VER) $(SDLDIR)/$(TORBUTTON_NAME) $(TORBUTTON_NAME) ; \
 		( cd $(TORBUTTON_NAME); $(SHELL) makexpi.sh ; ); \
-		mv $(TORBUTTON_NAME)/pkg/*.xpi $(ISODIR)/dl/src/torbutton.xpi ; rm -rf $(TORSVN_NAME); \
+		mv $(TORBUTTON_NAME)/pkg/*.xpi $(ISODIR)/dl/src/torbutton.xpi ; rm -rf $(TORBUTTON_NAME); \
 	fi; \
 	echo "--- Creating source archives from win32 tree ..."; \
 	( cd src && tar zcf ../$(ISODIR)/dl/src/torvm-w32.tgz torvm-w32 ); \

Modified: torvm/trunk/build/win32/files/buildall.sh
===================================================================
--- torvm/trunk/build/win32/files/buildall.sh	2009-06-08 19:18:44 UTC (rev 19663)
+++ torvm/trunk/build/win32/files/buildall.sh	2009-06-08 22:24:11 UTC (rev 19664)
@@ -3,8 +3,10 @@
 # and also transfer over the build log and shutdown, if needed.
 if [[ "$1" != "dobuild" ]]; then
   # only set various environment settings on the first pass
-  export PATH=.:/usr/local/bin:/usr/bin:/bin:/mingw/bin:/wix:/lib:/usr/local/lib:/usr/libexec:$PATH
+  export PATH=$PATH:/usr/local/bin:/wix:/lib:/usr/local/lib:/usr/libexec:$PATH
   export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib:/mingw/lib:$LD_LIBRARY_PATH
+  export CC=gcc
+  export DEF_CONF_BUILD="--build=i686-pc-mingw32"
 
   export KERNEL_IMAGE=/src/add/vmlinuz
   export VMHDD_IMAGE=/src/add/hdd.img
@@ -170,8 +172,6 @@
   fi
   if [ -f "$VSTOOLSENV" ]; then
     echo "Using VisualStudio environment script at $VSTOOLSENV."
-    export PATH="$PATH:$VSTOOLSDIR:$VSTOOLSDIR\Bin:$VSTOOLSDIR\VC\bin:$VSTOOLSDIR\Common7\IDE:$VSTOOLSDIR\SDK\v2.0\bin"
-    echo "Using new PATH=$PATH"
   fi
   
   # always set these since we may need to copy over failure logs
@@ -195,7 +195,7 @@
     fi
   fi
   cd /usr/src
-  /usr/src/buildall.sh dobuild 2>&1 | tee build.log
+  ./buildall.sh dobuild 2>&1 | tee build.log
   if (( $? != 0 )); then
     echo "BUILD_FAILED" >> build.log
   else
@@ -238,22 +238,15 @@
     fi
   done
 
-  # enforce particular versions of some build utils
-  cd /
-  tar xf /dl/m4*
-
   if [ -d /usr/usr ]; then
     # ahh, gotta love the msys /usr <-> / equivalence hack.
     cd /usr/usr
     if [ -d local ]; then
-      mv local ../
+      mkdir ../local
+      mv local/* ../local/
     fi
-    if [ -d bin ]; then
-      mv bin/* ../bin/
-      rmdir bin
-    fi
     cd ..
-    rmdir usr
+    rm -rf usr
   fi
   cp /usr/local/bin/aclocal-* /bin/aclocal
   cp /usr/local/bin/autoconf-* /bin/autoconf
@@ -400,7 +393,7 @@
   cd /usr/src
   tar zxf $LIBEVENT_FILE
   cd $LIBEVENT_DIR
-  ./configure --prefix=/usr --enable-static --disable-shared
+  ./configure --prefix=/usr --enable-static --disable-shared $DEF_CONF_BUILD
   if (( $? != 0 )); then
     echo "ERROR: libevent configure failed." >&2
     exit 1
@@ -422,7 +415,7 @@
   cd /usr/src
   tar zxf $SDL_FILE
   cd $SDL_DIR
-  ./configure --prefix=/usr
+  ./configure --prefix=/usr $DEF_CONF_BUILD
   if (( $? != 0 )); then
     echo "ERROR: SDL configure failed." >&2
     exit 1
@@ -459,7 +452,8 @@
    --disable-debug \
    --disable-lzo \
    --disable-ssl \
-   --disable-crypto 
+   --disable-crypto \
+   $DEF_CONF_BUILD
   if (( $? != 0 )); then
     echo "ERROR: openvpn configure failed." >&2
     exit 1
@@ -514,7 +508,6 @@
   fi
   cp $NPFDRV_F $bdlibdir/tornpf.sys
   cd Dll/Project
-  export CC=gcc
   make
   if (( $? != 0 )); then
     echo "ERROR: WinPcap Packet user space library build failed." >&2
@@ -553,14 +546,15 @@
     exit 1
   fi
   ./configure --prefix=/usr --interp-prefix=qemu-%M \
-    --enable-uname-release="Tor VM 2.6-alpha i386" \
+    --enable-uname-release="Tor VM" \
     --disable-werror \
     --disable-system \
     --disable-kqemu \
     --disable-vnc-tls \
     --extra-cflags="-DHAVE_INTSZ_TYPES -I. -I.. -I/src/$ZLIB_DIR -I/usr/include -I/usr/local/include $WPCAP_INCLUDE -I/src/pthreads-w32 -I/usr/include/SDL" \
     --extra-ldflags="-L/src/$ZLIB_DIR -L/usr/lib -L/usr/local/lib $WPCAP_LDFLAGS -L/src/pthreads-w32" \
-    --target-list=i386-softmmu
+    --target-list=i386-softmmu \
+    --enable-mingw32 --cross-prefix=""
   if (( $? != 0 )); then
     echo "ERROR: Qemu configure failed." >&2
     exit 1
@@ -602,7 +596,7 @@
   cd /usr/src
   tar zxf $GROFF_FILE
   cd $GROFF_DIR
-  ./configure --prefix=/usr
+  ./configure --prefix=/usr $DEF_CONF_BUILD
   if (( $? != 0 )); then
     echo "ERROR: groff configure failed." >&2
     exit 1
@@ -689,7 +683,8 @@
             --enable-shared \
             --enable-threads \
             --enable-local-appdata \
-            --disable-transparent
+            --disable-transparent \
+            $DEF_CONF_BUILD
     if (( $? != 0 )); then
       echo "ERROR: torsvn autoconf configure failed." >&2
       exit 1
@@ -841,6 +836,8 @@
   if [ -f /src/qt-mingwssl.patch ]; then
     patch -p1 < /src/qt-mingwssl.patch
   fi 
+  # note: for some reason -O2 can fail builds, and -O is default for CFLAGS but -O2 for CXXFLAGS?
+  export QMAKE_CFLAGS_RELEASE="-O3"
   QT_CONF="-confirm-license -opensource -release -shared -fast"
   QT_CONF="$QT_CONF -no-dbus -no-phonon -no-webkit -no-qdbus -no-opengl -no-qt3support -no-xmlpatterns"
   QT_CONF="$QT_CONF -qt-style-windowsxp -no-style-windowsvista"
@@ -859,6 +856,7 @@
       echo "ERROR: Qt build failed."
     fi
   fi
+  unset QMAKE_CFLAGS_RELEASE
 
   # XXX: so it seems some things (marble) want to try and load
   # image plugins that are not plugins, namely the .a libtool
@@ -881,7 +879,7 @@
   cd /usr/src
   tar zxf $GNURX_FILE
   cd $GNURX_DIR
-  ./configure --prefix=/usr
+  ./configure --prefix=/usr $DEF_CONF_BUILD
   if (( $? != 0 )); then
     echo "ERROR: GNU regex configure failed."
   fi

Modified: torvm/trunk/build/win32/files/install.bat
===================================================================
--- torvm/trunk/build/win32/files/install.bat	2009-06-08 19:18:44 UTC (rev 19663)
+++ torvm/trunk/build/win32/files/install.bat	2009-06-08 22:24:11 UTC (rev 19664)
@@ -51,9 +51,9 @@
 copy *.* %DDRV%%MDIR%\%MVER%\src\add\
 cd /d %DDRV%
 cd %MDIR%\%MVER%
-set PATH=%DDRV%%MDIR%\%MVER%\bin;%DDRV%%MDIR%\%MVER%;%PATH%
 set BUILDER=/usr/src/buildall.sh
 set MSYSROOT=C:\\msys\\1.0
+set MSYSTEM=msys
 md etc\profile.d
 ECHO export MSYSROOT="%MSYSROOT%" > etc\profile.d\defpaths.sh
 IF EXIST %ISODRV%\ssh (
@@ -68,10 +68,8 @@
 IF EXIST %ISODRV%\bldopts (
   copy %ISODRV%\bldopts etc\profile.d\bldopts.sh
 )
-set WD=C:\msys\1.0\bin\
-set PATH=%WD%;%PATH%
-
-%WD%bash --login %BUILDER%
+cd bin
+sh.exe --login %BUILDER%
 ECHO "Build completed."
 GOTO DONE