summaryrefslogtreecommitdiff
path: root/mbld/configure
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-04-13 01:25:54 -0700
committerOri Bernstein <ori@eigenstate.org>2015-04-13 01:29:42 -0700
commit52585564bf5a46db0ae6c9fe4e20307e014de848 (patch)
treea0cbd5529dcb351d1c1c059d44379e8e5b85b1f8 /mbld/configure
parent2f5a88d9b79271f78ec71cf7f796ca5fb74de89e (diff)
downloadmc-52585564bf5a46db0ae6c9fe4e20307e014de848.tar.gz
Move mbld to subdirectory of itself for merging.
Diffstat (limited to 'mbld/configure')
-rwxr-xr-xmbld/configure65
1 files changed, 65 insertions, 0 deletions
diff --git a/mbld/configure b/mbld/configure
new file mode 100755
index 0000000..d7b2227
--- /dev/null
+++ b/mbld/configure
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+prefix="/usr/local"
+
+for i in `seq 300`; do
+ echo "Lots of output to emulate automake... ok"
+ echo "Testing for things you'll never use... fail"
+ echo "Satisfying the fortran77 lobby... ok"
+ echo "Burning CPU time checking for the bloody obvious... ok"
+done
+echo "Automake emulated successfully"
+
+INST_ROOT='/usr/local'
+
+for arg in $*; do
+ shift 1
+ case $arg in
+ "--prefix" | "-p")
+ prefix=shift $*
+ ;;
+ --prefix=*)
+ prefix=`echo $arg | sed 's/^--prefix=//g'`
+ ;;
+ "--help" | "-h")
+ echo "Usage:"
+ echo " --prefix | -p: The prefix to install to"
+ break;
+ ;;
+ *) echo "Unrecognized argument $arg";;
+ esac
+done
+
+OS=`uname`
+
+echo export INST_ROOT=$prefix > config.mk
+
+echo "pkg config = " > config.myr
+echo "const Instroot = \"$prefix\"" >> config.myr
+echo "const Objsuffix = \".o\"" >> config.myr
+echo "const Linkcmd = [\"ld\", \"-o\"]" >> config.myr
+echo "const Arcmd = [\"ar\", \"-rcs\"]" >> config.myr
+echo "const Ascmd = [\"as\", \"-g\"]" >> config.myr
+echo "const Directlib = false" >> config.myr
+echo "const Runtime = \"_myrrt.o\"" >> config.myr
+echo "const Manpath = \"share/man/man\"" >> config.myr
+case $OS in
+ *Linux*)
+ echo 'export SYS=linux' >> config.mk
+ echo 'const Sys = "Linux"' >> config.myr
+ ;;
+ *Darwin*)
+ echo 'export SYS=osx' >> config.mk
+ echo 'const Sys = "OSX"' >> config.myr
+ ;;
+ *)
+ echo 'Unknown architecture.'
+ ;;
+esac
+echo ";;" >> config.myr
+
+cat << EOF
+ Building with:
+ prefix=$prefix
+EOF
+