diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-08-24 20:25:53 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-08-24 20:26:23 +0200 |
commit | a5ff9b623532ef2a15ca0a6ba315f2f463142490 (patch) | |
tree | 6c5b293c997089557e01f22aaab401ddc584c336 /src/ortho/gcc/ortho-lang-9.c | |
parent | 165a59c9fea5168954488dff1622388ef72a22ca (diff) | |
download | ghdl-a5ff9b623532ef2a15ca0a6ba315f2f463142490.tar.gz ghdl-a5ff9b623532ef2a15ca0a6ba315f2f463142490.tar.bz2 ghdl-a5ff9b623532ef2a15ca0a6ba315f2f463142490.zip |
ghdldrv: handle auxbase option in ortho/gcc. Fix #1845
Remove additional option in ghdldrv.adb,
automatically set aux_base_name in ortho-lang-9.c
Diffstat (limited to 'src/ortho/gcc/ortho-lang-9.c')
-rw-r--r-- | src/ortho/gcc/ortho-lang-9.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ortho/gcc/ortho-lang-9.c b/src/ortho/gcc/ortho-lang-9.c index b7dfab4f3..4059e5ac3 100644 --- a/src/ortho/gcc/ortho-lang-9.c +++ b/src/ortho/gcc/ortho-lang-9.c @@ -407,6 +407,22 @@ ortho_post_options (const char **pfilename) { if (*pfilename == NULL || strcmp (*pfilename, "-") == 0) *pfilename = "*stdin*"; + else if (aux_base_name == NULL) + { + /* Define auxbase. The default mechanism in toplev.c doesn't + handle extensions longer than 3 characters. */ + char *name = xstrdup (lbasename (main_input_filename)); + int len; + + /* Remove extension. */ + for (len = strlen (name) - 1; len > 1; len--) + if (name[len] == '.') + { + name[len] = 0; + break; + } + aux_base_name = name; + } /* Default hook. */ lhd_post_options (pfilename); |