Skip to content
Snippets Groups Projects
Commit c2200240 authored by fgilham's avatar fgilham
Browse files

Preserve library: search list when dumping an executable.

parent 04288a85
No related branches found
No related tags found
No related merge requests found
/* /*
* main() entry point for a stand alone lisp image. * main() entry point for a stand alone lisp image.
* *
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/lisp.c,v 1.56 2007/07/09 16:04:06 fgilham Exp $ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/lisp.c,v 1.57 2007/07/21 21:12:42 fgilham Exp $
* *
*/ */
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "core.h" #include "core.h"
#include "save.h" #include "save.h"
#include "lispregs.h" #include "lispregs.h"
#ifdef FEATURE_EXECUTABLE #if defined FEATURE_EXECUTABLE
#include "elf.h" #include "elf.h"
#endif #endif
...@@ -435,7 +435,7 @@ main(int argc, char *argv[], char *envp[]) ...@@ -435,7 +435,7 @@ main(int argc, char *argv[], char *envp[])
argptr = argv; argptr = argv;
while ((arg = *++argptr) != NULL) { while ((arg = *++argptr) != NULL) {
if (strcmp(arg, "-core") == 0) { if (strcmp(arg, "-core") == 0) {
#ifdef FEATURE_EXECUTABLE #if defined FEATURE_EXECUTABLE
if (builtin_image_flag) { if (builtin_image_flag) {
fprintf(stderr, fprintf(stderr,
"Cannot specify core file in executable image --- sorry about that.\n"); "Cannot specify core file in executable image --- sorry about that.\n");
...@@ -514,7 +514,7 @@ main(int argc, char *argv[], char *envp[]) ...@@ -514,7 +514,7 @@ main(int argc, char *argv[], char *envp[])
default_core = "lisp.core"; default_core = "lisp.core";
os_init(); os_init();
#ifdef FEATURE_EXECUTABLE #if defined FEATURE_EXECUTABLE
if (builtin_image_flag != 0) if (builtin_image_flag != 0)
map_core_sections(argv[0]); map_core_sections(argv[0]);
#endif #endif
...@@ -565,7 +565,14 @@ main(int argc, char *argv[], char *envp[]) ...@@ -565,7 +565,14 @@ main(int argc, char *argv[], char *envp[])
libvar = getenv("CMUCLLIB"); libvar = getenv("CMUCLLIB");
if (libvar != NULL) { if (libvar != NULL) {
cmucllib = strdup(libvar); cmucllib = strdup(libvar);
} else { } else
#if defined FEATURE_EXECUTABLE
/* The following doesn't make sense for executables.
They need to use the saved library path from the
lisp from which they were dumped. */
if (builtin_image_flag == 0)
#endif
{
char *newlib = NULL; char *newlib = NULL;
/* /*
...@@ -590,7 +597,7 @@ main(int argc, char *argv[], char *envp[]) ...@@ -590,7 +597,7 @@ main(int argc, char *argv[], char *envp[])
/* Only look for a core file if we're not using a built-in image. */ /* Only look for a core file if we're not using a built-in image. */
#ifdef FEATURE_EXECUTABLE #if defined FEATURE_EXECUTABLE
if (builtin_image_flag == 0) { if (builtin_image_flag == 0) {
#endif #endif
/* /*
...@@ -619,7 +626,7 @@ main(int argc, char *argv[], char *envp[]) ...@@ -619,7 +626,7 @@ main(int argc, char *argv[], char *envp[])
exit(1); exit(1);
} }
} }
#ifdef FEATURE_EXECUTABLE #if defined FEATURE_EXECUTABLE
} else { } else {
/* The "core file" is the executable. We have to save the /* The "core file" is the executable. We have to save the
* executable path because we operate on the executable file later. * executable path because we operate on the executable file later.
...@@ -630,7 +637,7 @@ main(int argc, char *argv[], char *envp[]) ...@@ -630,7 +637,7 @@ main(int argc, char *argv[], char *envp[])
globals_init(); globals_init();
#ifdef FEATURE_EXECUTABLE #if defined FEATURE_EXECUTABLE
if (builtin_image_flag != 0) { if (builtin_image_flag != 0) {
extern int image_dynamic_space_size; extern int image_dynamic_space_size;
long allocation_pointer = long allocation_pointer =
...@@ -689,7 +696,14 @@ main(int argc, char *argv[], char *envp[]) ...@@ -689,7 +696,14 @@ main(int argc, char *argv[], char *envp[])
SetSymbolValue(LISP_ENVIRONMENT_LIST, alloc_str_list(envp)); SetSymbolValue(LISP_ENVIRONMENT_LIST, alloc_str_list(envp));
/* Set cmucllib and cmuclcore appropriately */ /* Set cmucllib and cmuclcore appropriately */
SetSymbolValue(CMUCL_LIB, alloc_string(cmucllib)); #if defined FEATURE_EXECUTABLE
/* This test will preserve the library: search list dumped
with the executable unless the user specifically overrides
it with the -lib flag or by setting the CMUCLLIB environment
variable. */
if (cmucllib)
#endif
SetSymbolValue(CMUCL_LIB, alloc_string(cmucllib));
SetSymbolValue(CMUCL_CORE_PATH, alloc_string(core)); SetSymbolValue(CMUCL_CORE_PATH, alloc_string(core));
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment