aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/vms/vms-c.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/vms/vms-c.c')
-rw-r--r--gcc/config/vms/vms-c.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/gcc/config/vms/vms-c.c b/gcc/config/vms/vms-c.c
index 19291b6..b3e0d95 100644
--- a/gcc/config/vms/vms-c.c
+++ b/gcc/config/vms/vms-c.c
@@ -283,3 +283,50 @@ vms_c_register_pragma (void)
c_register_pragma (NULL, "__message", vms_pragma_message);
c_register_pragma (NULL, "__extern_prefix", vms_pragma_extern_prefix);
}
+
+/* Standard modules list. */
+static const char * const vms_std_modules[] = { "rtldef", "starlet_c", NULL };
+
+/* Find include modules in the include path. */
+
+void
+vms_c_register_includes (const char *sysroot,
+ const char *iprefix ATTRIBUTE_UNUSED, int stdinc)
+{
+ static const char dir_separator_str[] = { DIR_SEPARATOR, 0 };
+ struct cpp_dir *dir;
+
+ /* Add on standard include pathes. */
+ if (!stdinc)
+ return;
+
+ for (dir = get_added_cpp_dirs (SYSTEM); dir != NULL; dir = dir->next)
+ {
+ const char * const *lib;
+ for (lib = vms_std_modules; *lib != NULL; lib++)
+ {
+ char *path;
+ struct stat st;
+
+ if (sysroot != NULL)
+ path = concat (sysroot, dir->name, dir_separator_str, *lib, NULL);
+ else
+ path = concat (dir->name, dir_separator_str, *lib, NULL);
+
+ if (stat (path, &st) == 0 && S_ISDIR (st.st_mode))
+ {
+ cpp_dir *p;
+
+ p = XNEW (cpp_dir);
+ p->next = NULL;
+ p->name = path;
+ p->sysp = 1;
+ p->construct = 0;
+ p->user_supplied_p = 0;
+ add_cpp_dir_path (p, SYSTEM);
+ }
+ else
+ free (path);
+ }
+ }
+}