* Got rid of CAN_LOAD_OBJ. We'll only use dlopen()-like functions now.
git-svn-id: svn://svn.zoy.org/elk/trunk@115 55e467fa-43c5-0310-a8a2-de718669efc6
This commit is contained in:
parent
b7a437f9a5
commit
58b8dc6976
|
@ -166,13 +166,9 @@ if test "${ac_cv_my_have_elf}" = "yes"; then
|
|||
AC_DEFINE(HAVE_LIBELF, 1, Define if you have libelf.)
|
||||
ELK_LIBS="${ELK_LIBS} -lelf"
|
||||
ac_cv_my_can_dump=yes
|
||||
ac_cv_my_can_load_obj=yes
|
||||
ac_cv_my_can_load_lib=yes
|
||||
CAN_DUMP=1
|
||||
CAN_LOAD_OBJ=1
|
||||
else
|
||||
ac_cv_my_can_dump=no
|
||||
ac_cv_my_can_load_obj=no
|
||||
ac_cv_my_can_load_lib=no
|
||||
dnl AC_MSG_ERROR([could not handle the native object format, if you are running Linux please install the libelf development headers])
|
||||
fi
|
||||
|
@ -186,9 +182,6 @@ fi
|
|||
# dl SysVR4/SunOS5 dlopen()
|
||||
#
|
||||
# Leave load_obj empty if dynamic loading is not supported.
|
||||
if test "${ac_cv_my_can_load_obj}" = "yes"; then
|
||||
AC_DEFINE(CAN_LOAD_OBJ, 1, [FIXME HARD])
|
||||
fi
|
||||
if test "${ac_cv_my_can_load_lib}" = "yes"; then
|
||||
AC_DEFINE(CAN_LOAD_LIB, 1, [FIXME HARD])
|
||||
fi
|
||||
|
|
28
src/load.c
28
src/load.c
|
@ -34,21 +34,11 @@
|
|||
|
||||
Object V_Load_Path, V_Load_Noisilyp, V_Load_Libraries;
|
||||
|
||||
#ifdef CAN_LOAD_OBJ
|
||||
# define Default_Load_Libraries LOAD_LIBRARIES
|
||||
#else
|
||||
# define Default_Load_Libraries ""
|
||||
#endif
|
||||
|
||||
char *Loader_Input; /* tmp file name used by load.xx.c */
|
||||
|
||||
extern void Switch_Environment (Object);
|
||||
void Load_Source (Object);
|
||||
|
||||
#ifdef CAN_LOAD_OBJ
|
||||
void Fork_Load();
|
||||
#endif
|
||||
|
||||
#if defined(USE_LD)
|
||||
# include "load-ld.c"
|
||||
#elif defined(USE_RLD)
|
||||
|
@ -65,11 +55,7 @@ void Init_Load () {
|
|||
Cons (Make_String (SCM_DIR, sizeof (SCM_DIR) - 1),
|
||||
Cons (Make_String (OBJ_DIR, sizeof (OBJ_DIR) - 1), Null))));
|
||||
Define_Variable (&V_Load_Noisilyp, "load-noisily?", False);
|
||||
Define_Variable (&V_Load_Libraries, "load-libraries",
|
||||
Make_String (Default_Load_Libraries, sizeof Default_Load_Libraries-1));
|
||||
#ifdef CAN_LOAD_OBJ
|
||||
Register_Onfork (Fork_Load);
|
||||
#endif
|
||||
Define_Variable (&V_Load_Libraries, "load-libraries", Make_String ("", 0));
|
||||
}
|
||||
|
||||
void Init_Loadpath (char *s) { /* No GC possible here */
|
||||
|
@ -131,22 +117,12 @@ Object General_Load (Object what, Object env) {
|
|||
Switch_Environment (env);
|
||||
Check_Loadarg (what);
|
||||
if (TYPE(what) == T_Pair) {
|
||||
if (Has_Suffix (Car (what), ".o"))
|
||||
#ifdef CAN_LOAD_OBJ
|
||||
Load_Object (what)
|
||||
#endif
|
||||
;
|
||||
else if (Has_Suffix (Car (what), ".so"))
|
||||
if (Has_Suffix (Car (what), ".so"))
|
||||
#ifdef CAN_LOAD_LIB
|
||||
Load_Library (what)
|
||||
#endif
|
||||
;
|
||||
}
|
||||
else if (Has_Suffix (what, ".o"))
|
||||
#ifdef CAN_LOAD_OBJ
|
||||
Load_Object (Cons (what, Null))
|
||||
#endif
|
||||
;
|
||||
else if (Has_Suffix (what, ".so"))
|
||||
#ifdef CAN_LOAD_LIB
|
||||
Load_Library (Cons (what, Null))
|
||||
|
|
Loading…
Reference in New Issue