summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--6/main.c4
-rwxr-xr-xconfigure24
2 files changed, 26 insertions, 2 deletions
diff --git a/6/main.c b/6/main.c
index aac6842..0a49621 100644
--- a/6/main.c
+++ b/6/main.c
@@ -12,7 +12,8 @@
#include "parse.h"
#include "opt.h"
#include "asm.h"
-#include "platform.h"
+
+#include "../config.h"
/* FIXME: move into one place...? */
Node *file;
@@ -56,6 +57,7 @@ int main(int argc, char **argv)
Stab *globls;
char buf[1024];
+ lappend(&incpaths, &nincpaths, Instroot "include/myr");
while ((opt = getopt(argc, argv, "d::hSo:I:")) != -1) {
switch (opt) {
case 'o':
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