diff options
| author | Graydon Hoare <[email protected]> | 2011-03-17 14:26:24 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-03-17 14:26:32 -0700 |
| commit | 3ae9ca444ce244e2bab660de28a5bf7047aa3813 (patch) | |
| tree | 959ca1af375cfc9c383342e720984e452470f1a6 /configure | |
| parent | rustc: Correctly report mutability when stringifying types (diff) | |
| download | rust-3ae9ca444ce244e2bab660de28a5bf7047aa3813.tar.xz rust-3ae9ca444ce244e2bab660de28a5bf7047aa3813.zip | |
Move Makefile.in and configure to top level, BOOT_-qualify names, various tweaks.
Diffstat (limited to 'configure')
| -rwxr-xr-x | configure | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/configure b/configure new file mode 100755 index 00000000..0e584f35 --- /dev/null +++ b/configure @@ -0,0 +1,75 @@ +#!/bin/sh + +CFG_SRC_DIR=${0%${0##*/}} +CFG_BUILD_DIR=$PWD + +echo "configure: recreating config.mk" +echo '' >config.mk + +echo "configure: making directories" +for i in \ + doc \ + boot/fe boot/me boot/be boot/driver boot/util \ + rt/isaac rt/bigint rt/sync rt/test +do + mkdir -p -v $i +done + +make_test_subdirs() { + for t in run-pass run-fail compile-fail + do + mkdir -p -v $1/test/$t + done +} + +make_test_subdirs boot + +for i in 0 1 2 +do + mkdir -p -v stage$i + make_test_subdirs stage$i +done + +echo "configure: copying Makefile" +cp -v ${CFG_SRC_DIR}Makefile.in ./Makefile + +putvar() { + local T + eval T=\$$1 + printf "%-20s := %s\n" $1 $T + printf "%-20s := %s\n" $1 $T >>config.mk +} + +probe() { + local V=$1 + local P=$2 + local T + T=$(which $P 2>&1) + if [ $? -ne 0 ] + then + T="" + fi + eval $V=\$T + putvar $V +} + +echo "configure: inspecting environment" + +CFG_OSTYPE=$(uname -s) +CFG_CPUTYPE=$(uname -m) + +putvar CFG_SRC_DIR +putvar CFG_BUILD_DIR +putvar CFG_OSTYPE +putvar CFG_CPUTYPE + +echo "configure: looking for programs" +probe CFG_VALGRIND valgrind +probe CFG_OCAMLC ocamlc +probe CFG_OCAMLC_OPT ocamlc.opt +probe CFG_OCAMLOPT ocamlopt +probe CFG_OCAMLOPT_OPT ocamlopt.opt +probe CFG_FLEXLINK flexlink +probe CFG_LLVM_CONFIG llvm-config + +echo "configure: complete" |