mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
Add win32 dynamic loading.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3034 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
078c123074
commit
93c529ee3d
12 changed files with 469 additions and 621 deletions
|
@ -1,3 +1,10 @@
|
|||
Tue Oct 6 16:35:48 1998 Adam Fedor <fedor@doc.com>
|
||||
|
||||
* aclocal.m4: Add win32 test
|
||||
* configure.in: Use DYNAMIC_LINKER test.
|
||||
* src/GNUmakefile: Add win32-load.h
|
||||
* src/win32-load.h: New file.
|
||||
|
||||
Sat Oct 6 16:45:00 1998 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* src/FastMap.x: New map table for dictionaries.
|
||||
|
|
|
@ -46,11 +46,6 @@
|
|||
#include <gnustep/base/RBTreeNode.h>
|
||||
#include <gnustep/base/SplayTree.h>
|
||||
|
||||
/* Magnitude objects */
|
||||
#include <gnustep/base/Magnitude.h>
|
||||
#include <gnustep/base/Random.h>
|
||||
#include <gnustep/base/Time.h>
|
||||
|
||||
/* Stream objects */
|
||||
#include <gnustep/base/Stream.h>
|
||||
#include <gnustep/base/StdioStream.h>
|
||||
|
|
|
@ -205,7 +205,6 @@ LinkedList.h \
|
|||
LinkedListNode.h \
|
||||
Locking.h \
|
||||
MachPort.h \
|
||||
Magnitude.h \
|
||||
MappedCollector.h \
|
||||
MemoryStream.h \
|
||||
NotificationDispatcher.h \
|
||||
|
@ -216,9 +215,6 @@ Port.h \
|
|||
Queue.h \
|
||||
RBTree.h \
|
||||
RBTreeNode.h \
|
||||
RNGAdditiveCongruential.h \
|
||||
RNGBerkeley.h \
|
||||
RandomGenerating.h \
|
||||
RawCStream.h \
|
||||
Retaining.h \
|
||||
RunLoop.h \
|
||||
|
@ -230,7 +226,6 @@ Stream.h \
|
|||
Streaming.h \
|
||||
TcpPort.h \
|
||||
TextCStream.h \
|
||||
Time.h \
|
||||
UdpPort.h \
|
||||
Unicode.h \
|
||||
UnixFileHandle.h \
|
||||
|
@ -254,11 +249,17 @@ o_map.h \
|
|||
o_map_bas.h \
|
||||
o_map_cbs.h \
|
||||
objc-gnu2next.h \
|
||||
all.h \
|
||||
README \
|
||||
preface.h
|
||||
|
||||
#Random.h \
|
||||
GNU_EXTRAS_HFILES = \
|
||||
all.h \
|
||||
Magnitude.h \
|
||||
Random.h \
|
||||
RNGAdditiveCongruential.h \
|
||||
RNGBerkeley.h \
|
||||
RandomGenerating.h \
|
||||
Time.h
|
||||
|
||||
# NEXTSTEP source files
|
||||
|
||||
|
@ -378,6 +379,7 @@ dld-load.h \
|
|||
hpux-load.h \
|
||||
null-load.h \
|
||||
simple-load.h \
|
||||
win32-load.h \
|
||||
NSCallBacks.h \
|
||||
tzfile.h
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
dld-load - Definitions and translations for dynamic loading with GNU dld.
|
||||
|
||||
Copyright (C) 1995, Adam Fedor.
|
||||
Copyright (C) 1995, Free Software Foundation.
|
||||
|
||||
BUGS:
|
||||
- object files loaded by dld must be loaded with 'ld -r' rather
|
||||
|
@ -20,7 +20,7 @@
|
|||
#include <dld/defs.h>
|
||||
|
||||
/* This is the GNU gcc name for the CTOR list */
|
||||
#define DLD_CTOR_LIST "___CTOR_LIST__"
|
||||
#define CTOR_LIST "___CTOR_LIST__"
|
||||
|
||||
/* The compiler generates a constructor function for each class. The function
|
||||
has the prefix given below.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
hpux-load - Definitions and translations for dynamic loading with HP-UX
|
||||
|
||||
Copyright (C) 1995, Adam Fedor.
|
||||
Copyright (C) 1995, Free Software Foundation
|
||||
|
||||
*/
|
||||
|
||||
|
@ -10,6 +10,9 @@
|
|||
|
||||
#include <dl.h>
|
||||
|
||||
/* This is the GNU name for the CTOR list */
|
||||
#define CTOR_LIST "__CTOR_LIST__"
|
||||
|
||||
/* link flags */
|
||||
#define LINK_FLAGS (BIND_IMMEDIATE | BIND_VERBOSE)
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#ifndef __null_load_h_INCLUDE
|
||||
#define __null_load_h_INCLUDE
|
||||
|
||||
#define CTOR_LIST ""
|
||||
|
||||
/* Types defined appropriately for the dynamic linker */
|
||||
typedef void* dl_handle_t;
|
||||
|
|
|
@ -46,9 +46,6 @@ extern void sarray_free(struct sarray*);
|
|||
/* Declaration from NSBundle.m */
|
||||
const char *objc_executable_location( void );
|
||||
|
||||
/* This is the GNU name for the CTOR list */
|
||||
#define CTOR_LIST "___CTOR_LIST__"
|
||||
|
||||
/* dynamic_loaded is YES if the dynamic loader was sucessfully initialized. */
|
||||
static BOOL dynamic_loaded;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
simple-load - Definitions and translations for dynamic loading with
|
||||
the simple dynamic liading library (dl).
|
||||
|
||||
Copyright (C) 1995, Adam Fedor.
|
||||
Copyright (C) 1995, Free Software Foundation
|
||||
|
||||
BUGS:
|
||||
- In SunOS 4.1, dlopen will only resolve references into the main
|
||||
|
@ -17,6 +17,9 @@
|
|||
|
||||
#include <dlfcn.h>
|
||||
|
||||
/* This is the GNU name for the CTOR list */
|
||||
#define CTOR_LIST "__CTOR_LIST__"
|
||||
|
||||
#ifndef RTLD_GLOBAL
|
||||
#define RTLD_GLOBAL 0
|
||||
#endif
|
||||
|
|
77
Source/win32-load.h
Normal file
77
Source/win32-load.h
Normal file
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
win32-load - Definitions and translations for dynamic loading with
|
||||
the windows.
|
||||
|
||||
Copyright (C) 1998, Free Software Foundation
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __win32_load_h_INCLUDE
|
||||
#define __win32_load_h_INCLUDE
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
/* This is the GNU name for the CTOR list */
|
||||
#define CTOR_LIST ""
|
||||
|
||||
/* Types defined appropriately for the dynamic linker */
|
||||
typedef HINSTANCE dl_handle_t;
|
||||
typedef void* dl_symbol_t;
|
||||
|
||||
/* Do any initialization necessary. Return 0 on success (or
|
||||
if no initialization needed.
|
||||
*/
|
||||
static int
|
||||
__objc_dynamic_init(const char* exec_path)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Link in the module given by the name 'module'. Return a handle which can
|
||||
be used to get information about the loded code.
|
||||
*/
|
||||
static dl_handle_t
|
||||
__objc_dynamic_link(const char* module, int mode, const char* debug_file)
|
||||
{
|
||||
return LoadLibraryEx(module, 0, 0);
|
||||
}
|
||||
|
||||
/* Return the address of a symbol given by the name 'symbol' from the module
|
||||
associated with 'handle'
|
||||
*/
|
||||
static dl_symbol_t
|
||||
__objc_dynamic_find_symbol(dl_handle_t handle, const char* symbol)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* remove the code from memory associated with the module 'handle' */
|
||||
static int
|
||||
__objc_dynamic_unlink(dl_handle_t handle)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Print an error message (prefaced by 'error_string') relevant to the
|
||||
last error encountered
|
||||
*/
|
||||
static void
|
||||
__objc_dynamic_error(FILE *error_stream, const char *error_string)
|
||||
{
|
||||
fprintf(error_stream, "%s:%d\n", error_string, GetLastError());
|
||||
}
|
||||
|
||||
/* Debugging: define these if they are available */
|
||||
static int
|
||||
__objc_dynamic_undefined_symbol_count(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char**
|
||||
__objc_dynamic_list_undefined_symbols(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif /* __sunos_load_h_INCLUDE */
|
8
aclocal.m4
vendored
8
aclocal.m4
vendored
|
@ -105,20 +105,18 @@ AC_DEFUN(OBJC_SYS_DYNAMIC_LINKER,
|
|||
# Makes the following substitutions:
|
||||
# DYNAMIC_LINKER - cooresponds to the interface that is included
|
||||
# in objc-load.c (i.e. #include "${DYNAMIC_LINKER}-load.h")
|
||||
# LIBS - Updated to include the system library that
|
||||
# performs dynamic linking.
|
||||
#--------------------------------------------------------------------
|
||||
DYNAMIC_LINKER=null
|
||||
AC_CHECK_HEADER(dlfcn.h, DYNAMIC_LINKER=simple)
|
||||
if test $DYNAMIC_LINKER = null; then
|
||||
AC_CHECK_HEADER(dl.h, DYNAMIC_LINKER=hpux)
|
||||
fi
|
||||
if test $DYNAMIC_LINKER = null; then
|
||||
AC_CHECK_HEADER(windows.h, DYNAMIC_LINKER=win32)
|
||||
fi
|
||||
if test $DYNAMIC_LINKER = null; then
|
||||
AC_CHECK_HEADER(dld/defs.h, DYNAMIC_LINKER=dld)
|
||||
fi
|
||||
# Should only include one of the following libs.
|
||||
AC_CHECK_LIB(dl, dlopen, LIBS="${LIBS} -ldl")
|
||||
AC_CHECK_LIB(dld, main, LIBS="${LIBS} -ldld")
|
||||
|
||||
AC_SUBST(DYNAMIC_LINKER)dnl
|
||||
])
|
||||
|
|
|
@ -183,7 +183,7 @@ AC_SUBST(NEXT_INCLUDES)
|
|||
#--------------------------------------------------------------------
|
||||
# Setup dynamic linking
|
||||
#--------------------------------------------------------------------
|
||||
OBJC_SYS_DYNAMIC_FLAGS()
|
||||
OBJC_SYS_DYNAMIC_LINKER()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Generic settings needed by NSZone.m
|
||||
|
|
Loading…
Reference in a new issue