[MLton-commit] r7325

Wesley Terpstra wesley at mlton.org
Sun Nov 1 12:25:52 PST 2009


Restructure the MLton.msi build system to use toolchains completely from the
mingw-w64 project (ie: even the 32-bit toolchain).


----------------------------------------------------------------------

U   mlton/trunk/package/mingw/Makefile
U   mlton/trunk/package/mingw/mlton.wxs
A   mlton/trunk/package/mingw/toolchain.sh

----------------------------------------------------------------------

Modified: mlton/trunk/package/mingw/Makefile
===================================================================
--- mlton/trunk/package/mingw/Makefile	2009-11-01 17:51:42 UTC (rev 7324)
+++ mlton/trunk/package/mingw/Makefile	2009-11-01 20:25:50 UTC (rev 7325)
@@ -1,5 +1,5 @@
 MLTON=../../build/bin/mlton
-PKG=self runtime w32api binutils gcc gmp msys gdb dlfcn wget self64 gmp64 mingw64
+PKG=self32 self64 mingw32 mingw64 gmp32 gmp64 dlfcn32 dlfcn64 msys wget 7z
 
 PKG_LST=$(patsubst %,%.lst,$(PKG))
 PKG_WXS=$(patsubst %,%.wxs,$(PKG))
@@ -17,7 +17,7 @@
 %.exe:		%.sml
 	$(MLTON) $<
 
-self.lst:	files2cmp.exe
+self32.lst:	files2cmp.exe
 	rm -rf staging
 	$(MAKE) -C ../.. PREFIX= install
 	mv ../../install staging
@@ -25,7 +25,7 @@
 	cd staging; find * -type f > ../$@.tmp
 	mv $@.tmp $@
 
-self64.lst:	self.lst
+self64.lst:	self32.lst
 	rm -rf ../../runtime.x64
 	cp -a ../../runtime ../../runtime.x64
 	$(MAKE) -C ../../runtime.x64 TARGET=x86_64-w64-mingw32 TARGET_ARCH=amd64 TARGET_OS=mingw clean all
@@ -41,10 +41,10 @@
 	./staging/mlton -target x86_64-w64-mingw32 -build-constants true > staging/w64-constants.c
 	./staging/mlton -target x86_64-w64-mingw32 -verbose 1 staging/w64-constants.c
 	./staging/w64-constants > staging/lib/mlton/x86_64-w64-mingw32/constants
-	cd staging; find lib/mlton/x86_64-w64-mingw32 lib/mlton/sml/basis/config/c/amd64-mingw -type f > ../$@.tmp
+	cd staging; find * -type f | grep -v self > ../$@.tmp
 	mv $@.tmp $@
 
-%.lst:	dl/%.get self.lst
+%.lst:	dl/%.get self64.lst
 	cd staging; . ../$< | tar --exclude postinstall -t -k | sed 's@^\./@@' > ../$@.tmp
 	cd staging; . ../$< | tar -x
 	mv $@.tmp $@

Modified: mlton/trunk/package/mingw/mlton.wxs
===================================================================
--- mlton/trunk/package/mingw/mlton.wxs	2009-11-01 17:51:42 UTC (rev 7324)
+++ mlton/trunk/package/mingw/mlton.wxs	2009-11-01 20:25:50 UTC (rev 7325)
@@ -74,64 +74,59 @@
       </Component>
     </DirectoryRef>
 
-    <Feature Id='MLton' Title='MLton' Description='A whole-program optimizing Standard ML compiler.' Display='expand' Level='1' ConfigurableDirectory='INSTALLDIR' AllowAdvertise='no'>
-      <ComponentGroupRef Id='component.self' />
+    <Feature Id='MLton32' Title='MLton32' Description='A whole-program optimizing Standard ML compiler.' Display='expand' Level='1' ConfigurableDirectory='INSTALLDIR' AllowAdvertise='no'>
+      <ComponentGroupRef Id='component.self32' />
       <ComponentRef Id='component.bin_mlton.bat' />
       <ComponentRef Id='component.path' />
       <ComponentRef Id='component.download.url' />
       <ComponentRef Id='component.readme.txt' />
       <ComponentRef Id='component.documentation' />
-    </Feature>
-
-    <Feature Id='MinGW32' Title='MinGW32' Description='The minimalist GNU for Windows C compiler toolchain, targetting Win32.' Level='1' ConfigurableDirectory='INSTALLDIR' AllowAdvertise='no'>
-      <Feature Id='Runtime' Title='Runtime' Description='An assortment of thin wrappers that provide POSIX-like functionality on a windows platform.' Level='1' AllowAdvertise='no'>
-        <ComponentGroupRef Id='component.runtime' />
+      <Feature Id='MinGW32' Title='MinGW32' Description='The minimalist GNU for Windows C compiler toolchain, targetting Win32.' Level='1' ConfigurableDirectory='INSTALLDIR' AllowAdvertise='no'>
+        <ComponentGroupRef Id='component.mingw32' />
       </Feature>
-      <Feature Id='W32API' Title='Win32 API' Description='Headers and link stub libraries needed to access windows system DLLs.' Level='1' AllowAdvertise='no'>
-        <ComponentGroupRef Id='component.w32api' />
-      </Feature>
-      <Feature Id='Binutils' Title='Binutils' Description='Utilities for manipulating object files, such as the linker and assembler.' Level='1' AllowAdvertise='no'>
-        <ComponentRef Id='component.path' />
-        <ComponentGroupRef Id='component.binutils' />
-      </Feature>
-      <Feature Id='GCC' Title='GCC' Description='The GNU C Compiler. Compiles C files to assembly.' Level='1' AllowAdvertise='no'>
-        <ComponentRef Id='component.path' />
-        <ComponentGroupRef Id='component.gcc' />
-      </Feature>
-      <Feature Id='MSYS' Title='MSYS' Description='A system shell along with UNIX-style command-line utilities.' Level='1' AllowAdvertise='no'>
-        <ComponentRef Id='component.start_msys' />
-        <ComponentRef Id='component.bin_msys.bat' />
-        <ComponentRef Id='component.path' />
-        <ComponentGroupRef Id='component.msys' />
-      </Feature>
-      <Feature Id='GMP' Title='GMP' Description='An arbitrary precision integer artihmetic library.' Level='1' ConfigurableDirectory='INSTALLDIR' AllowAdvertise='no'>
-        <ComponentGroupRef Id='component.gmp' />
+      <Feature Id='GMP32' Title='GMP32' Description='An arbitrary precision integer artihmetic library.' Level='1' ConfigurableDirectory='INSTALLDIR' AllowAdvertise='no'>
+        <ComponentGroupRef Id='component.gmp32' />
       </Feature>
-      <Feature Id='dlfcn' Title='Dlfcn' Description='An implementation of the POSIX dynamic linking loader API for Windows.' Level='1' ConfigurableDirectory='INSTALLDIR' AllowAdvertise='no'>
-        <ComponentGroupRef Id='component.dlfcn' />
+      <Feature Id='dlfcn32' Title='Dlfcn32' Description='An implementation of the POSIX dynamic linking loader API for Windows 32.' Level='1' ConfigurableDirectory='INSTALLDIR' AllowAdvertise='no'>
+        <ComponentGroupRef Id='component.dlfcn32' />
       </Feature>
-      <Feature Id='GDB' Title='GDB' Description='A command-line operated program debugger.' Level='10' AllowAdvertise='no'>
-        <ComponentRef Id='component.path' />
-        <ComponentGroupRef Id='component.gdb' />
-      </Feature>
-      <Feature Id='WGet' Title='WGet' Description='A command-line tool for retrieving files from the web.' Level='10' AllowAdvertise='no'>
-        <ComponentRef Id='component.path' />
-        <ComponentGroupRef Id='component.wget' />
-      </Feature>
     </Feature>
 
-    <Feature Id='Win64' Title='Win64' Description='Support compiling programs for the Win64 platform.' Level='10' ConfigurableDirectory='INSTALLDIR' AllowAdvertise='no'>
-      <Feature Id='MinGW64' Title='MinGW64' Description='The minimalist GNU for Windows C compiler toolchain, targetting Win64 platforms.' Level='10' AllowAdvertise='no'>
-        <ComponentGroupRef Id='component.mingw64' />
-      </Feature>
-      <Feature Id='MLton64' Title='MLton64' Description='Libraries and target information to build 64-bit SML programs.' Level='10' AllowAdvertise='no'>
-        <ComponentGroupRef Id='component.self64' />
-      </Feature>
-      <Feature Id='GMP64' Title='GMP64' Description='An arbitrary precision integer artihmetic library.' Level='10' ConfigurableDirectory='INSTALLDIR' AllowAdvertise='no'>
+    <Feature Id='MLton64' Title='MLton64' Description='A whole-program optimizing Standard ML compiler.' Display='expand' Level='10' ConfigurableDirectory='INSTALLDIR' AllowAdvertise='no'>
+      <ComponentGroupRef Id='component.self64' />
+      <ComponentRef Id='component.bin_mlton.bat' />
+      <ComponentRef Id='component.path' />
+      <ComponentRef Id='component.download.url' />
+      <ComponentRef Id='component.readme.txt' />
+      <ComponentRef Id='component.documentation' />
+      <Feature Id='MinGW64' Title='MinGW64' Description='The minimalist GNU for Windows C compiler toolchain, targetting Win64.' Level='10' ConfigurableDirectory='INSTALLDIR' AllowAdvertise='no'>
+        <ComponentGroupRef Id='component.mingw64' />
+      </Feature>
+      <Feature Id='GMP64' Title='GMP64' Description='An arbitrary precision integer artihmetic library.' Level='1' ConfigurableDirectory='INSTALLDIR' AllowAdvertise='no'>
         <ComponentGroupRef Id='component.gmp64' />
       </Feature>
-    </Feature>
+      <Feature Id='dlfcn64' Title='Dlfcn64' Description='An implementation of the POSIX dynamic linking loader API for Windows 64.' Level='10' ConfigurableDirectory='INSTALLDIR' AllowAdvertise='no'>
+        <ComponentGroupRef Id='component.dlfcn64' />
+      </Feature>
+    </Feature>
+    
+    <Feature Id='MSYS' Title='MSYS' Description='A system shell along with UNIX-style command-line utilities.' Level='1' AllowAdvertise='no'>
+      <ComponentRef Id='component.start_msys' />
+      <ComponentRef Id='component.bin_msys.bat' />
+      <ComponentRef Id='component.path' />
+      <ComponentGroupRef Id='component.msys' />
+    </Feature>
+
+    <Feature Id='WGet' Title='WGet' Description='A command-line tool for retrieving files from the web.' Level='10' AllowAdvertise='no'>
+      <ComponentRef Id='component.path' />
+      <ComponentGroupRef Id='component.wget' />
+    </Feature>
 
+    <Feature Id='7Zip' Title='7Zip' Description='A command-line tool for decompressing files.' Level='10' AllowAdvertise='no'>
+      <ComponentRef Id='component.path' />
+      <ComponentGroupRef Id='component.7zip' />
+    </Feature>
+
     <UIRef Id="WixUI_Mondo" />
     <WixVariable Id="WixUIBannerBmp" Value="Bitmaps/bannrbmp.bmp" />
     <WixVariable Id="WixUIDialogBmp" Value="Bitmaps/dlgbmp.bmp" />

Added: mlton/trunk/package/mingw/toolchain.sh
===================================================================
--- mlton/trunk/package/mingw/toolchain.sh	2009-11-01 17:51:42 UTC (rev 7324)
+++ mlton/trunk/package/mingw/toolchain.sh	2009-11-01 20:25:50 UTC (rev 7325)
@@ -0,0 +1,24 @@
+#! /bin/bash
+
+mirror="http://downloads.sourceforge.net/mingw-w64/files/"
+mingw32="mingw-w32-1.0-bin_i686-mingw_20091023.zip"
+mingw64="mingw-w64-1.0-bin_i686-mingw_20091023.zip"
+
+for i in "$mingw32" "$mingw64"; do
+  wget -c "$mirror/$i"
+  mkdir tmp
+  cd tmp
+  7z x "../$i" 
+  
+  mv lib/libiberty.a *-mingw32/lib
+  rm -rf mingw share man include info
+  # toolchain binaries are 32-bit, but the libraries are 32/64 bit
+  strip -p `find . -name \*.exe`
+  chmod +x *-mingw32/bin/strip.exe # noop on mingw, but helps on linux
+  ./*-mingw32/bin/strip.exe -p --strip-debug --strip-unneeded `find . -name \*.[ao]`
+  
+  dest=`basename "$i" .zip`
+  7z a "../$dest.7z" -mx=9 *
+  cd ..
+  rm -rf tmp
+done


Property changes on: mlton/trunk/package/mingw/toolchain.sh
___________________________________________________________________
Name: svn:executable
   + *




More information about the MLton-commit mailing list