diff options
author | Gaius Mulley <gaiusmod2@gmail.com> | 2025-08-28 12:08:33 +0100 |
---|---|---|
committer | Gaius Mulley <gaiusmod2@gmail.com> | 2025-08-28 12:08:33 +0100 |
commit | 69faef01dff124cd2e657b7525ba6cc574626853 (patch) | |
tree | 166592b4eaa918875e5a2fe17094832a8c93c7c9 /libjava/classpath | |
parent | 098cf067772921764e7eb618e3e0614a7df0a947 (diff) | |
download | gcc-69faef01dff124cd2e657b7525ba6cc574626853.zip gcc-69faef01dff124cd2e657b7525ba6cc574626853.tar.gz gcc-69faef01dff124cd2e657b7525ba6cc574626853.tar.bz2 |
PR modula2/121629: adding third party modules
This patch makes it easier to add third party modules.
cc1gm2 now appends the search directory prefix/include/m2
to the search path for non dialect specific modules.
Prior to this it appends the dialect specific subdirectories
{m2pim,m2iso,m2log,m2min} with the appropriate dialect pathname.
The patch also includes a new option -fm2-pathname-root=prefix
which allow additional prefix/m2 directories to be searched
before the default.
gcc/ChangeLog:
PR modula2/121629
* doc/gm2.texi (Module Search Path): New section.
(Compiler options): New option -fm2-pathname-root=.
New option -fm2-pathname-rootI.
gcc/m2/ChangeLog:
PR modula2/121629
* gm2-compiler/PathName.mod: Add copyright notice.
* gm2-lang.cc (named_path): Add field lib_root.
(push_back_Ipath): Set lib_root false.
(push_back_lib_root): New function.
(get_dir_sep_size): Ditto.
(add_path_component): Ditto.
(add_one_import_path): Ditto.
(add_non_dialect_specific_path): Ditto.
(foreach_lib_gen_import_path): Ditto.
(get_module_source_dir): Ditto.
(add_default_include_paths): Ditto.
(assign_flibs): Ditto.
(m2_pathname_root): Ditto.
(add_m2_import_paths): Remove function.
(gm2_langhook_post_options): Call assign_flibs.
Check np.lib_root and call foreach_lib_gen_import_path.
Replace call to add_m2_import_paths with a call to
add_default_include_paths.
(gm2_langhook_handle_option): Add case OPT_fm2_pathname_rootI_.
* gm2spec.cc (named_path): Add field lib_root.
(push_back_Ipath): Set lib_root false.
(push_back_lib_root): New function.
(add_m2_I_path): Add OPT_fm2_pathname_rootI_ option
if np.lib_root.
(lang_specific_driver): Add case OPT_fm2_pathname_root_.
* lang.opt (fm2-pathname-root=): New option.
(fm2-pathname-rootI=): Ditto.
gcc/testsuite/ChangeLog:
PR modula2/121629
* gm2/switches/pathnameroot/pass/switches-pathnameroot-pass.exp: New test.
* gm2/switches/pathnameroot/pass/test.mod: New test.
* gm2/switches/pathnameroot/pass/testlib/m2/foo.def: New test.
* gm2/switches/pathnameroot/pass/testlib/m2/foo.mod: New test.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
Diffstat (limited to 'libjava/classpath')
0 files changed, 0 insertions, 0 deletions