From 6d25b4f3fc23601b3a84b4a70aab40ba429ac4b9 Mon Sep 17 00:00:00 2001 From: xleroy Date: Tue, 30 Dec 2008 14:48:33 +0000 Subject: Reorganized the development, modularizing away machine-dependent parts. Started to merge the ARM code generator. Started to add support for PowerPC/EABI. Use ocamlbuild to construct executable from Caml files. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@930 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- configure | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 91 insertions(+), 6 deletions(-) (limited to 'configure') diff --git a/configure b/configure index bd1b7bb..0d71d27 100755 --- a/configure +++ b/configure @@ -16,6 +16,22 @@ cildistrib=cil-1.3.5.tar.gz prefix=/usr/local bindir='$(PREFIX)/bin' libdir='$(PREFIX)/lib/compcert' +target='' + +usage='Usage: ./configure [options] + +Supported targets: + macosx (PowerPC, MacOS X) + ppc-linux (PowerPC, Linux) + ppc-linux-cross (PowerPC, Linux, cross-compilation) + arm-linux (ARM, Linux) + arm-linux-cross (ARM, Linux, cross-compilation) + +Options: + -prefix Install in /bin and /lib/compcert + -bindir Install binaries in + -libdir Install libraries in +' # Parse command-line arguments @@ -28,11 +44,64 @@ while : ; do bindir=$2; shift;; -libdir|--libdir) libdir=$2; shift;; - *) echo "Unknown option \"$1\"." 1>&2; exit 2;; + *) + if test -n "$target"; then echo "$usage" 1>&2; exit 2; fi + target="$1";; esac shift done +if test -z "$target"; then echo "$usage" 1>&2; exit 2; fi + +# Per-target configuration + +case "$target" in + macosx) + arch="powerpc" + variant="macosx" + cc="gcc -arch ppc" + cprepro="gcc -arch ppc -U__GNUC__ -E" + casm="gcc -arch ppc -c" + clinker="gcc -arch ppc" + libmath="";; + ppc-linux) + arch="powerpc" + variant="eabi" + cc="gcc" + cprepro="gcc -U__GNUC__ -E" + casm="gcc -c" + clinker="gcc" + libmath="-lm";; + ppc-linux-cross) + arch="powerpc" + variant="eabi" + cc="ppc-linux-gcc" + cprepro="ppc-linux-gcc -U__GNUC__ -E" + casm="ppc-linux-gcc -c" + clinker="ppc-linux-gcc" + libmath="-lm";; + arm-linux) + arch="arm" + variant="linux" + cc="gcc" + cprepro="gcc -U__GNUC__ -E" + casm="gcc -c" + clinker="gcc" + libmath="-lm";; + arm-linux-cross) + arch="arm" + variant="linux" + cc="arm-linux-gcc" + cprepro="arm-linux-gcc -U__GNUC__ -E" + casm="arm-linux-gcc -c" + clinker="arm-linux-gcc" + libmath="-lm";; + *) + echo "Unsupported configuration '$target'" 1>&2 + echo "$usage" 1>&2 + exit 2;; +esac + # Generate Makefile.config rm -f Makefile.config @@ -40,11 +109,13 @@ cat > Makefile.config <