summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2012-09-19 01:20:50 -0400
committerOri Bernstein <ori@eigenstate.org>2012-09-19 01:20:50 -0400
commitb80e9fa019f244bf9e562f629aeffaded103dec7 (patch)
tree9b5c9bbcaafe296589e7fc9e34a6955c57f914af /configure
parent5ce1ef188530525a21db822bafcd7886d96fcb92 (diff)
downloadmc-b80e9fa019f244bf9e562f629aeffaded103dec7.tar.gz
Improve build system flexibility a bit.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure24
1 files changed, 23 insertions, 1 deletions
diff --git a/configure b/configure
index 50c0b30..342b94d 100755
--- a/configure
+++ b/configure
@@ -10,6 +10,8 @@ for i in `seq 300`; do
done
echo "Automake emulated successfully"
+INST_ROOT='/usr/local'
+
for arg in $*; do
shift 1
case $arg in
@@ -28,9 +30,29 @@ for arg in $*; do
esac
done
+OS=`uname`
+
+echo export INST_ROOT=$prefix > config.mk
+echo \#define Instroot "\"$prefix\"" > config.h
+
+case $OS in
+ *Linux*)
+ echo '#define Asmcmd "as -g -o %s %s"' >> config.h
+ echo '#define Fprefix ""' >> config.h
+ ;;
+ *Darwin*)
+ echo '\#define Asmcmd "as -g -o %s %s"' >> config.h
+ echo '\#define Fprefix "_"' >> config.h
+ ;;
+ *)
+ echo 'Unknown architecture. Assuming Linux ABI.'
+ echo '#define Asmcmd "as -g -o %s %s"' >> config.h
+ echo '#define Fprefix "' >> config.h
+ ;;
+esac
+
cat << EOF
Building with:
prefix=$prefix
EOF
-echo export INST_ROOT=$prefix > config.mk