#include "machine.h"
#include "nesc-atomic.h"
#include "unparse.h"
+#include "nesc-main.h"
+
/* The set of C files to require before loading the main component */
struct ilist
{
struct ilist *next;
char *name;
+ bool name_is_path;
};
static struct ilist *includelist, **includelist_end = &includelist;
static region includeregion;
-void add_nesc_include(const char *name)
+void add_nesc_include(const char *name, bool name_is_path)
{
struct ilist *np;
np = ralloc(includeregion, struct ilist);
np->next = NULL;
np->name = rstrdup(includeregion, name);
+ np->name_is_path = name_is_path;
*includelist_end = np;
includelist_end = &np->next;
}
else if (!strncmp (p, "fnesc-include=", strlen("fnesc-include=")))
{
- add_nesc_include(p + strlen("fnesc-include="));
+ add_nesc_include(p + strlen("fnesc-include="), FALSE);
}
else if (!strncmp (p, "fnesc-path=", strlen("fnesc-path=")))
{
flag_default_safe = 1;
else if (!strcmp (p, "fnesc-default-unsafe"))
flag_default_safe = 0;
+ else if (!strcmp (p, "fnesc-gccize"))
+ flag_gccize = 1;
else if (!strcmp (p, "Wnesc-docstring"))
warn_unexpected_docstring = 1;
else if (!strcmp (p, "Wno-nesc-docstring"))
target->init();
for (includes = includelist; includes; includes = includes->next)
- require_c(toplevel_location, includes->name);
+ if (includes->name_is_path)
+ load_c(toplevel_location, includes->name, TRUE);
+ else
+ require_c(toplevel_location, includes->name);
if (flag_use_scheduler)
load_scheduler();