Skip to content
Snippets Groups Projects
configure 1.62 KiB
Newer Older
#######################################################################
#                                                                     #
#              The Compcert verified compiler                         #
#                                                                     #
#          Xavier Leroy, INRIA Paris-Rocquencourt                     #
#                                                                     #
#  Copyright Institut National de Recherche en Informatique et en     #
#  Automatique.  All rights reserved.  This file is distributed       #
#  under the terms of the INRIA Non-Commercial License Agreement.     #
#                                                                     #
#######################################################################

cildistrib=cil-1.3.5.tar.gz
prefix=/usr/local
bindir='$(PREFIX)/bin'
libdir='$(PREFIX)/lib/compcert'

# Parse command-line arguments

while : ; do
  case "$1" in
    "") break;;
    -prefix|--prefix)
        prefix=$2; shift;;
    -bindir|--bindir)
        bindir=$2; shift;;
    -libdir|--libdir)
        libdir=$2; shift;;
    *) echo "Unknown option \"$1\"." 1>&2; exit 2;;
  esac
  shift
done

# Generate Makefile.config

rm -f Makefile.config
cat > Makefile.config <<EOF
PREFIX=$prefix
BINDIR=$bindir
LIBDIR=$libdir
CC=gcc -arch ppc
CPREPRO=gcc -arch ppc -U__GNUC__ -E
CASM=gcc -arch ppc -c
CLINKER=gcc -arch ppc
LIBMATH=
EOF

# Extract and configure Cil

set -e
tar xzf $cildistrib
for i in cil.patch/*; do patch -p1 < $i; done
(cd cil && ./configure)

# Extract 'ARCHOS' info from Cil configuration

grep '^ARCHOS=' cil/config.log >> Makefile.config