Index: configure =================================================================== --- configure (.../vendor/ocaml/3.10.2) (revision 402) +++ configure (.../trunk/ocamlbase) (revision 402) @@ -667,6 +667,7 @@ *) aspp='as'; asppflags='-P -DSYS_$(SYSTEM)';; esac;; i386,*,solaris) aspp='/usr/ccs/bin/as'; asppflags='-P -DSYS_$(SYSTEM)';; + i386,*,macosx) aspp='gcc-4.2'; asppflags='-m32 -c -DSYS_$(SYSTEM)';; i386,*,*) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';; hppa,*,*) aspp="$cc"; asppflags='-traditional -c -DSYS_$(SYSTEM)';; power,*,elf) aspp='gcc'; asppflags='-c';; Index: Makefile.base =================================================================== --- Makefile.base (.../vendor/ocaml/3.10.2) (revision 0) +++ Makefile.base (.../trunk/ocamlbase) (revision 402) @@ -0,0 +1,26 @@ +# Extra rules for ARM (iPhone, iPad) cross compiler +# +# Need to build this (native) base compiler first, then the cross +# compiler. Cross compiler should be in ../OCamlXARM + +# Define XARMTARGET, the installation directory for the XARM compiler +# +include Makefile.xarmtarg + +# Apple native toolchain +# +BASEGCC = gcc-4.2 -arch i386 + +# Build the base compiler +# +base-build: + ./configure \ + -bindir $(XARMTARGET)/bin \ + -libdir $(XARMTARGET)/lib/ocaml \ + -mandir $(XARMTARGET)/man/man1 \ + -no-curses \ + -no-tk \ + -cc '$(BASEGCC)' + make clean + rm -rf world.log + make world bootstrap opt > world.log 2>&1 Index: asmcomp/i386/proc.ml =================================================================== --- asmcomp/i386/proc.ml (.../vendor/ocaml/3.10.2) (revision 402) +++ asmcomp/i386/proc.ml (.../trunk/ocamlbase) (revision 402) @@ -181,7 +181,12 @@ (* Calling the assembler *) let assemble_file infile outfile = - Ccomp.command ("as -o " ^ Filename.quote outfile ^ " " ^ Filename.quote infile) + let as_cmd = + if Config.system = "macosx" then + "as -arch i386 -o " + else + "as -o " in + Ccomp.command (as_cmd ^ Filename.quote outfile ^ " " ^ Filename.quote infile) open Clflags;; open Config;; Index: Makefile =================================================================== --- Makefile (.../vendor/ocaml/3.10.2) (revision 402) +++ Makefile (.../trunk/ocamlbase) (revision 402) @@ -14,7 +14,7 @@ # The main Makefile -include config/Makefile +-include config/Makefile include stdlib/StdlibModules CAMLC=boot/ocamlrun boot/ocamlc -nostdlib -I boot @@ -685,3 +685,4 @@ FORCE: include .depend +include Makefile.base Index: Makefile.xarmtarg =================================================================== --- Makefile.xarmtarg (.../vendor/ocaml/3.10.2) (revision 0) +++ Makefile.xarmtarg (.../trunk/ocamlbase) (revision 402) @@ -0,0 +1,3 @@ +# Target for installing the OCaml ARM (iPhone, iPad) cross compiler +# +XARMTARGET = /usr/local/ocamlxarm