summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-12-22 19:01:00 -0800
committerOri Bernstein <ori@eigenstate.org>2014-12-22 19:01:00 -0800
commite9f4727e6dbe517ea9a8f381e45f71137cbbf9ab (patch)
tree031488ad9db25b148aeca4a43140353be76041c8
parent44dc8c62e81aae1adf3f91f5c78e421c98079116 (diff)
downloadmc-e9f4727e6dbe517ea9a8f381e45f71137cbbf9ab.tar.gz
Use the right 'ar' command on plan9.
-rwxr-xr-xconfigure7
-rw-r--r--mkfile1
-rw-r--r--myrbuild/myrbuild.c8
3 files changed, 8 insertions, 8 deletions
diff --git a/configure b/configure
index 2312739..51f723e 100755
--- a/configure
+++ b/configure
@@ -35,21 +35,20 @@ MACH=`uname -m`
echo export INST_ROOT=$prefix > config.mk
echo '#define Instroot "'$prefix'"' > config.h
+echo '#define Asmcmd {"as", "-g", "-o", NULL}' >> config.h
+echo '#define Linkcmd {"ar", "-rcs", NULL}' >> config.h
+echo '#define Defaultasm Gnugas' >> config.h
case $OS in
*Linux*)
- echo '#define Asmcmd {"as", "-g", "-o", NULL}' >> config.h
echo '#define Symprefix ""' >> config.h
echo '#define Defaultasm Gnugas' >> config.h
echo 'export SYS=linux' >> config.mk
;;
*Darwin*)
- echo '#define Asmcmd {"as", "-g", "-o", NULL}' >> config.h
echo '#define Symprefix "_"' >> config.h
- echo '#define Defaultasm Gnugas' >> config.h
echo 'export SYS=osx' >> config.mk
;;
*FreeBSD*)
- echo '#define Asmcmd {"as", "-g", "-o", NULL}' >> config.h
echo '#define Symprefix ""' >> config.h
echo '#define Defaultasm Gnugas' >> config.h
echo 'export SYS=freebsd' >> config.mk
diff --git a/mkfile b/mkfile
index 5e2975b..d94faec 100644
--- a/mkfile
+++ b/mkfile
@@ -43,6 +43,7 @@ uninstall:V: $SUB config.h
config.h:
echo '#define Instroot "'/'"' > config.h
echo '#define Asmcmd {"6a", "-o", NULL}' >> config.h
+ echo '#define Linkcmd {"ar", "ru", NULL}' >> config.h
echo '#define Symprefix "_"' >> config.h
echo '#define Defaultasm Plan9' >> config.h
diff --git a/myrbuild/myrbuild.c b/myrbuild/myrbuild.c
index b2715be..668c48d 100644
--- a/myrbuild/myrbuild.c
+++ b/myrbuild/myrbuild.c
@@ -26,7 +26,7 @@ int genasm = 0;
/* binaries we call out to */
char *mc = "6m";
char *as[] = Asmcmd;
-char *ar = "ar";
+char *ar[] = Linkcmd;
char *ld = "ld";
char *muse = "muse";
char *runtime = Instroot "/lib/myr/_myrrt.o";
@@ -361,8 +361,8 @@ void archive(char **files, size_t nfiles)
args = NULL;
nargs = 0;
snprintf(buf, sizeof buf, "lib%s.a", libname);
- lappend(&args, &nargs, strdup(ar));
- lappend(&args, &nargs, strdup("-rcs"));
+ for (i = 0; ar[i]; i++)
+ lappend(&args, &nargs, strdup(ar[i]));
lappend(&args, &nargs, strdup(buf));
for (i = 0; i < nfiles; i++) {
if (hassuffix(files[i], ".myr"))
@@ -505,7 +505,7 @@ int main(int argc, char **argv)
case 'A': as[0] = ctx.optarg; break;
case 'M': muse = ctx.optarg; break;
case 'L': ld = ctx.optarg; break;
- case 'R': ar = ctx.optarg; break;
+ case 'R': ar[0] = ctx.optarg; break;
case 'r':
if (!strcmp(ctx.optarg, "none"))
runtime = NULL;