b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | --- a/src/files.c |
| 2 | +++ b/src/files.c |
| 3 | @@ -560,9 +560,9 @@ pkgdatadir (void) |
| 4 | char const * |
| 5 | m4path (void) |
| 6 | { |
| 7 | - char const *m4 = getenv ("M4"); |
| 8 | + char const *m4 = getenv ("STAGING_DIR_HOST"); |
| 9 | if (m4) |
| 10 | - return m4; |
| 11 | + return strcat(getenv ("STAGING_DIR_HOST"), "/bin/m4"); |
| 12 | |
| 13 | /* We don't use relocate2() to store the temporary buffer and re-use |
| 14 | it, because m4path() is only called once. */ |
| 15 | --- a/src/getargs.c |
| 16 | +++ b/src/getargs.c |
| 17 | @@ -373,11 +373,13 @@ usage (int status) |
| 18 | A --long option is required. |
| 19 | Otherwise, add exceptions to ../build-aux/cross-options.pl. */ |
| 20 | |
| 21 | - printf (_("Usage: %s [OPTION]... FILE\n"), program_name); |
| 22 | + printf (_("Usage: STAGING_DIR_HOST=... %s [OPTION]... FILE\n"), program_name); |
| 23 | fputs (_("\ |
| 24 | Generate a deterministic LR or generalized LR (GLR) parser employing\n\ |
| 25 | LALR(1), IELR(1), or canonical LR(1) parser tables.\n\ |
| 26 | \n\ |
| 27 | +Environment Variable STAGING_DIR_HOST controls path to m4\n\ |
| 28 | +\n\ |
| 29 | "), stdout); |
| 30 | |
| 31 | fputs (_("\ |
| 32 | @@ -450,6 +452,11 @@ Output Files:\n\ |
| 33 | -M, --file-prefix-map=OLD=NEW replace prefix OLD with NEW when writing file paths\n\ |
| 34 | in output files\n\ |
| 35 | "), stdout); |
| 36 | + |
| 37 | + fputs (_("\ |
| 38 | +Environment Variables:\n\ |
| 39 | + STAGING_DIR_HOST Path to m4 is [STAGING_DIR_HOST]/bin/m4\n\ |
| 40 | +"), stdout); |
| 41 | putc ('\n', stdout); |
| 42 | |
| 43 | argmatch_report_usage (stdout); |