ref: 92d743d5e5eaf030196e52bdcc94b8c1735c1219
parent: 410752ea2d5f6661e363379d14bd255521ca46e7
author: Ori Bernstein <[email protected]>
date: Mon Oct 1 12:52:29 EDT 2012
Fix include paths for build files
--- a/6/main.c
+++ b/6/main.c
@@ -57,7 +57,7 @@
Stab *globls;
char buf[1024];
- lappend(&incpaths, &nincpaths, Instroot "include/myr");
+ lappend(&incpaths, &nincpaths, Instroot "/lib/myr");
while ((opt = getopt(argc, argv, "d::hSo:I:")) != -1) {
switch (opt) {
case 'o':
--- a/libstd/Makefile
+++ b/libstd/Makefile
@@ -43,6 +43,6 @@
install:
- mkdir -p $(INST_ROOT)/myr/lib/
- install libstd.a $(INST_ROOT)/myr/lib/
- install std $(INST_ROOT)/myr/lib/
+ mkdir -p $(INST_ROOT)/lib/myr
+ install libstd.a $(INST_ROOT)/lib/myr
+ install std $(INST_ROOT)/lib/myr
--- a/muse/muse.c
+++ b/muse/muse.c
@@ -11,6 +11,8 @@
#include "parse.h"
+#include "../config.h"
+
/* FIXME: move into one place...? */
Node *file;
char *outfile;
@@ -87,6 +89,7 @@
int opt;
int i;
+ lappend(&incpaths, &nincpaths, Instroot "/lib/myr");
while ((opt = getopt(argc, argv, "d::hmo:I:")) != -1) {
switch (opt) {
case 'h':
@@ -104,9 +107,9 @@
while (optarg && *optarg)
debugopt[*optarg++ & 0x7f] = 1;
break;
- case 'I':
- lappend(&incpaths, &nincpaths, optarg);
- break;
+ case 'I':
+ lappend(&incpaths, &nincpaths, optarg);
+ break;
default:
usage(argv[0]);
exit(0);
--- a/myrbuild/myrbuild.c
+++ b/myrbuild/myrbuild.c
@@ -54,7 +54,7 @@
pathlen = strlen(path);
sufflen = strlen(suffix);
-
+
if (sufflen > pathlen)
return 0;
return !strcmp(&path[pathlen-sufflen], suffix);
--- a/parse/use.c
+++ b/parse/use.c
@@ -44,7 +44,7 @@
int c;
if (fgetc(f) != 'U')
- return 0;
+ return 0;
pkg = rdstr(f);
/* if the package names match up, or the usefile has no declared
* package, then we simply add to the current stab. Otherwise,
@@ -63,20 +63,20 @@
}
}
while ((c = fgetc(f)) != 'Z') {
- switch(c) {
- case 'G':
- case 'D':
+ switch(c) {
+ case 'G':
+ case 'D':
dcl = symunpickle(f);
putdcl(s, dcl);
break;
- case 'T':
+ case 'T':
n = mkname(-1, rdstr(f));
t = tyunpickle(f);
puttype(s, n, t);
break;
- case EOF:
- break;
- }
+ case EOF:
+ break;
+ }
}
return 1;
}
@@ -90,25 +90,25 @@
/* local (quoted) uses are always relative to the cwd */
fd = NULL;
if (use->use.islocal) {
- fd = fopen(use->use.name, "r");
+ fd = fopen(use->use.name, "r");
/* nonlocal (barename) uses are always searched on the include path */
} else {
- for (i = 0; i < nincpaths; i++) {
- p = strjoin(incpaths[i], "/");
+ for (i = 0; i < nincpaths; i++) {
+ p = strjoin(incpaths[i], "/");
q = strjoin(p, use->use.name);
- fd = fopen(q, "r");
- if (fd) {
- free(p);
- free(q);
- break;
- }
- }
+ fd = fopen(q, "r");
+ if (fd) {
+ free(p);
+ free(q);
+ break;
+ }
+ }
}
if (!fd)
fatal(use->line, "Could not open %s", use->use.name);
if (!loaduse(fd, st))
- die("Could not load usefile %s", use->use.name);
+ die("Could not load usefile %s", use->use.name);
}
/* Usefile format:
@@ -129,28 +129,27 @@
st = file->file.exports;
wrbyte(f, 'U');
if (st->name)
- wrstr(f, namestr(st->name));
+ wrstr(f, namestr(st->name));
else
- wrstr(f, NULL);
+ wrstr(f, NULL);
k = htkeys(st->ty, &n);
for (i = 0; i < n; i++) {
- t = gettype(st, k[i]);
- wrbyte(f, 'T');
+ t = gettype(st, k[i]);
+ wrbyte(f, 'T');
wrstr(f, namestr(k[i]));
- typickle(t, f);
+ typickle(t, f);
}
free(k);
k = htkeys(st->dcl, &n);
for (i = 0; i < n; i++) {
- s = getdcl(st, k[i]);
- if (s->decl.isgeneric)
- wrbyte(f, 'G');
- else
- wrbyte(f, 'D');
- sympickle(s, f);
+ s = getdcl(st, k[i]);
+ if (s->decl.isgeneric)
+ wrbyte(f, 'G');
+ else
+ wrbyte(f, 'D');
+ sympickle(s, f);
}
free(k);
wrbyte(f, 'Z');
}
-