diff options
-rw-r--r-- | 6/main.c | 4 | ||||
-rwxr-xr-x | configure | 24 |
2 files changed, 26 insertions, 2 deletions
@@ -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': @@ -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 |