]> git.ipfire.org Git - thirdparty/gcc.git/commit
a68: support for -fmodules-map and -fmodules-map-file
authorJose E. Marchesi <jose.marchesi@oracle.com>
Sun, 14 Dec 2025 10:22:35 +0000 (11:22 +0100)
committerJose E. Marchesi <jose.marchesi@oracle.com>
Tue, 16 Dec 2025 12:20:46 +0000 (13:20 +0100)
commitdc46237d10da999186ab0f36bb330ba3dbe8ce2d
treea5348baa6271716bd07d546e8b50bb705475ded8
parentf5ffb084e1c2f9d679306c9999f8d3cb53a79d23
a68: support for -fmodules-map and -fmodules-map-file

This commit adds support for two new command-line options for the
Algol 68 front-end:

  -fmodules-map=<string>
  -fmodules-map-file=<filename>

These options are used in order to specify a mapping from module
indicants to file basenames.  The compiler will base its search for
the modules on these basenames rather on the default schema of
deriving the basename from the module indicant.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog

* lang.opt (-fmodules-map): New option.
(-fmodules-map-file): Likewise.
* a68.h: Add prototype for a68_process_module_map.
* a68-imports.cc (SKIP_WHITESPACES): Define.
(PARSE_BASENAME): Likewise.
(PARSE_INDICANT): Likewise.
(a68_process_module_map): New function.
* a68-lang.cc: (a68_init): Move initialization of
A68_MODULE_FILES from there...
(a68_init_options): to here.
(a68_handle_option): Handle OPT_fmodules_map and
OPT_fmodules_map_.
* a68-parser-pragmat.cc (handle_access_in_pragmat): Normalize
module indicants to upper case.
* ga68.texi (Module search options): New section.
gcc/algol68/a68-imports.cc
gcc/algol68/a68-lang.cc
gcc/algol68/a68-parser-pragmat.cc
gcc/algol68/a68.h
gcc/algol68/ga68.texi
gcc/algol68/lang.opt
gcc/testsuite/algol68/execute/modules/Modules20.map [new file with mode: 0644]
gcc/testsuite/algol68/execute/modules/module-bar.a68 [new file with mode: 0644]
gcc/testsuite/algol68/execute/modules/module-foo.a68 [new file with mode: 0644]
gcc/testsuite/algol68/execute/modules/program-19.a68 [new file with mode: 0644]
gcc/testsuite/algol68/execute/modules/program-20.a68 [new file with mode: 0644]