[MLton-commit] r4880

Matthew Fluet fluet at mlton.org
Wed Nov 29 20:44:29 PST 2006


Improve add-cross to copy
  basis-library/config/c/$(TARGET_ARCH)-$(TARGET_OS)
directory.  Also, improved supported targets.


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

U   mlton/branches/on-20050822-x86_64-branch/bin/add-cross

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

Modified: mlton/branches/on-20050822-x86_64-branch/bin/add-cross
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/bin/add-cross	2006-11-30 04:33:32 UTC (rev 4879)
+++ mlton/branches/on-20050822-x86_64-branch/bin/add-cross	2006-11-30 04:44:29 UTC (rev 4880)
@@ -82,10 +82,12 @@
 echo 'Making runtime.' 
 ( cd "$src" && tar cf - Makefile basis-library bin include runtime ) | 
         ssh $machine "cd $tmp && tar xf - && cd runtime &&
-                ../bin/mmake OMIT_BYTECODE=yes TARGET_ARCH=$crossArch TARGET_OS=$crossOS clean all &&
+                ../bin/mmake COMPILE_FAST=yes OMIT_BYTECODE=yes TARGET_ARCH=$crossArch TARGET_OS=$crossOS clean all &&
 		cd .. && make dirs runtime"
 ssh $machine "cd $tmp/build/lib/self && tar cf - ." | 
         ( cd "$lib/$crossTarget" && tar xf - )
+ssh $machine "cd $tmp/basis-library/config/c && tar cf - $crossArch-$crossOS" | 
+        ( cd "$lib/sml/basis/config/c" && tar xf - )
 ( cd "$src" &&
         mmake TARGET=$crossTarget TARGET_ARCH=$crossArch TARGET_OS=$crossOS \
                 mlbpathmap targetmap )
@@ -99,12 +101,52 @@
 ;;
 esac
 
+# Copied from mlton-script
+case "$crossArch" in
+amd64)
+        archOpts='-m32'
+;;
+hppa)
+        archOpts=''
+;;
+sparc)
+        archOpts='-m32'
+;;
+x86)
+        archOpts=''
+;;
+esac
+
 case "$crossOS" in
+aix)
+        osOpts=''
+;;
+cygwin)
+        osOpts=''
+;;
+darwin)
+        osOpts='-I/opt/local/include -I/sw/include -L/opt/local/lib -L/sw/lib -lgmp'
+;;
+freebsd)
+        osOpts='-I/usr/local/include -L/usr/local/lib/ -lgmp'
+;;
+hpux)
+        osOpts=''
+;;
+linux)
+        osOpts=''
+;;
 mingw)
 	libs='-lws2_32 -lkernel32 -lpsapi -lnetapi32'
 ;;
+netbsd)
+        osOpts='-I/usr/pkg/include -Wl,-R/usr/pkg/lib -L/usr/pkg/lib/ -lgmp'
+;;
+openbsd)
+        osOpts='-I/usr/local/include -L/usr/local/lib/ -lgmp'
+;;
 solaris)
-        libs='-lrt -lnsl -lsocket'
+        osOpts='-lnsl -lsocket -lrt'
 ;;
 esac
 
@@ -113,6 +155,6 @@
 "$src/build/bin/mlton" -build-constants true | 
         ssh $machine "cd $tmp/runtime &&
                         cat >$exe.c && 
-                        gcc -I. -o $exe $exe.c libmlton.a libgdtoa.a -lgmp -lm $libs"
+                        gcc $archOpts $osOpts -I. -o $exe $exe.c libmlton.a libgdtoa.a -lgmp -lm"
 ssh $machine "$tmp/runtime/$exe$suf" >"$lib/$crossTarget/constants"
 ssh $machine "rm -rf $tmp"




More information about the MLton-commit mailing list