diff options
author | Keith Packard <keithp@keithp.com> | 2003-10-27 06:30:29 +0000 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2003-10-27 06:30:29 +0000 |
commit | 394b2bf04651d62194c7faa836899d33ca3ed017 (patch) | |
tree | e78a2199f53ca1212dc48ef1feea9ea7a4d9f0bc /fc-lang/fc-lang.c | |
parent | 3541556bd38d6b1a3fffe1a661edce2f8d60e06a (diff) |
Attempts to fix 'make distcheck' work. Things are progressing pretty well,
but there are still failures long into the process dealing with docs
(as always).
The big changes here are mostly to make $(srcdir) != "." work correctly,
fixing the docbook related sections and fc-lang were particularily
tricky. Docbook refuses to load system entities from anywhere other
than where the original .sgml file was located, so no luck looking in
"." for the configure-generated version.sgml and confdir.sgml files.
fc-lang needed help finding .orth files; added a -d option to set the
directory as the least evil of many options.
Now to go use a faster machine and try and wring out the last issues.
Diffstat (limited to 'fc-lang/fc-lang.c')
-rw-r--r-- | fc-lang/fc-lang.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/fc-lang/fc-lang.c b/fc-lang/fc-lang.c index ef259bc5..edfad3bf 100644 --- a/fc-lang/fc-lang.c +++ b/fc-lang/fc-lang.c @@ -75,6 +75,26 @@ get_line (FILE *f, char *line, int *lineno) return line; } +char *dir = 0; + +FILE * +scanopen (char *file) +{ + FILE *f; + + f = fopen (file, "r"); + if (!f && dir) + { + char path[1024]; + + strcpy (path, dir); + strcat (path, "/"); + strcat (path, file); + f = fopen (path, "r"); + } + return f; +} + /* * build a single charset from a source file * @@ -103,7 +123,7 @@ scan (FILE *f, char *file) end = strlen (file); if (file[end-1] == '\n') file[end-1] = '\0'; - f = fopen (file, "r"); + f = scanopen (file); if (!f) fatal (file, 0, "can't open"); c = scan (f, file); @@ -213,6 +233,11 @@ main (int argc, char **argv) while (*++argv) { + if (!strcmp (*argv, "-d")) + { + dir = *++argv; + continue; + } if (i == MAX_LANG) fatal (*argv, 0, "Too many languages"); files[i++] = *argv; @@ -222,7 +247,7 @@ main (int argc, char **argv) i = 0; while (files[i]) { - f = fopen (files[i], "r"); + f = scanopen (files[i]); if (!f) fatal (files[i], 0, strerror (errno)); sets[i] = scan (f, files[i]); |