From eaf9fdfc5fb7d296c16df34384914e0a62639314 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Mon, 29 Nov 2010 08:21:05 +0000 Subject: Add support for translator and linker in the driver --- src/driver/main.c | 2 ++ src/driver/utils.c | 23 +++++++++++++++-------- src/driver/utils.h | 3 ++- 3 files changed, 19 insertions(+), 9 deletions(-) (limited to 'src/driver') diff --git a/src/driver/main.c b/src/driver/main.c index ad2eac1d..3dd06ebe 100644 --- a/src/driver/main.c +++ b/src/driver/main.c @@ -127,6 +127,8 @@ main(int argc, char* argv[]) case core_driver: case script_driver: case compiler_driver: + case translator_driver: + case linker_driver: putenv("LC_ALL=C"); setlocale(LC_ALL, ""); return execute_core(&command, driver); diff --git a/src/driver/utils.c b/src/driver/utils.c index 20e130fb..42b0183d 100644 --- a/src/driver/utils.c +++ b/src/driver/utils.c @@ -130,11 +130,10 @@ get_driver_name(Driver driver) case script_driver: case compiler_driver: case core_driver: + case translator_driver: + case linker_driver: return OPENAXIOM_CORE_PATH; - case alien_driver: - return 0; - default: abort(); } @@ -163,7 +162,6 @@ build_rts_options(Command* command, Driver driver) case sman_driver: case execute_driver: case unknown_driver: - case alien_driver: break; case core_driver: @@ -171,6 +169,8 @@ build_rts_options(Command* command, Driver driver) case compiler_driver: case script_driver: + case translator_driver: + case linker_driver: switch (OPENAXIOM_BASE_RTS) { case gcl_runtime: command->rt_args.allocate(3); @@ -200,6 +200,12 @@ build_rts_options(Command* command, Driver driver) command->rt_args[1] = (char*) "-norc"; break; + case ecl_runtime: + command->rt_args.allocate(2); + command->rt_args[0] = (char*) "-q"; + command->rt_args[1] = (char*) "-norc"; + break; + default: abort(); } @@ -298,16 +304,17 @@ preprocess_arguments(Command* command, int argc, char** argv) } else if (const char* val = is_prefix("--execpath=", argv[i])) { command->exec_path = val; - driver = alien_driver; - break; } else { /* Apparently we will invoke the Core system; we need to pass on this option. */ if (strcmp(argv[i], "--script") == 0) driver = script_driver; - else if(strcmp(argv[i], "--compile") == 0) + else if(strcmp(argv[i], "--compile") == 0 + or strcmp(argv[i], "--translate") == 0) driver = compiler_driver; + else if (strcmp(argv[i], "--make") == 0) + driver = linker_driver; else { if (argv[i][0] == '-') /* Maybe option for the driver. */ @@ -478,7 +485,7 @@ execute_core(const Command* command, Driver driver) args[command->rt_args.size() + command->core.argc] = NULL; execv(execpath, args.data()); - perror(strerror(errno)); + perror(execpath); return -1; #endif /* __WIN32__ */ } diff --git a/src/driver/utils.h b/src/driver/utils.h index 70b5bb85..10f47f79 100644 --- a/src/driver/utils.h +++ b/src/driver/utils.h @@ -55,7 +55,8 @@ namespace OpenAxiom { script_driver, // start the core system in script mode. compiler_driver, // start the core system in compiler mode. execute_driver, // Execute a command. - alien_driver // Alien driver. + translator_driver, // Start the core system in translator mode. + linker_driver // start the core system in linking mode. }; // A list of runtime support systems for OpenAxiom. -- cgit v1.2.3