Removed legacy libltdl code and force using system libltdl instead.

This commit is contained in:
Volker Ruppert 2024-03-23 12:02:56 +01:00
parent 8a81eebedb
commit 7cd532db9a
7 changed files with 36 additions and 4672 deletions

View File

@ -1,4 +1,4 @@
# Copyright (C) 2001-2021 The Bochs Project
# Copyright (C) 2001-2024 The Bochs Project
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@ -178,7 +178,7 @@ all: @PRIMARY_TARGET@ @PLUGIN_TARGET@ bximage@EXE@ @OPTIONAL_TARGET@ @BUILD_DOCB
bochs@EXE@: @IODEV_LIB_VAR@ @DISPLAY_LIB_VAR@ @HDIMAGE_LIB_VAR@ @USB_LIB_VAR@ @NETWORK_LIB_VAR@ @SOUND_LIB_VAR@ \
@DEBUGGER_VAR@ cpu/libcpu.a @AVX_LIB_VAR@ cpu/cpudb/libcpudb.a memory/libmemory.a \
gui/libgui.a @INSTRUMENT_VAR@ $(BX_OBJS) \
$(SIMX86_OBJS) @FPU_VAR@ @GDBSTUB_VAR@ @PLUGIN_VAR@
$(SIMX86_OBJS) @FPU_VAR@ @GDBSTUB_VAR@
@LINK@ @EXPORT_DYNAMIC@ $(BX_OBJS) $(SIMX86_OBJS) \
@IODEV_LIB_VAR@ @DISPLAY_LIB_VAR@ @HDIMAGE_LIB_VAR@ @USB_LIB_VAR@ @NETWORK_LIB_VAR@ @SOUND_LIB_VAR@ \
@DEBUGGER_VAR@ cpu/libcpu.a @AVX_LIB_VAR@ cpu/cpudb/libcpudb.a \
@ -199,12 +199,12 @@ bochs@EXE@: @IODEV_LIB_VAR@ @DISPLAY_LIB_VAR@ @HDIMAGE_LIB_VAR@ @USB_LIB_VAR@ @N
.win32_dll_plugin_target: @IODEV_LIB_VAR@ @DISPLAY_LIB_VAR@ @HDIMAGE_LIB_VAR@ @USB_LIB_VAR@ @NETWORK_LIB_VAR@ \
@SOUND_LIB_VAR@ @DEBUGGER_VAR@ cpu/libcpu.a @AVX_LIB_VAR@ cpu/cpudb/libcpudb.a \
memory/libmemory.a gui/libgui.a @INSTRUMENT_VAR@ \
$(BX_OBJS) $(SIMX86_OBJS) @FPU_VAR@ @GDBSTUB_VAR@ @PLUGIN_VAR@
$(BX_OBJS) $(SIMX86_OBJS) @FPU_VAR@ @GDBSTUB_VAR@
$(DLLTOOL) --export-all-symbols --output-def bochs.def \
$(BX_OBJS) $(SIMX86_OBJS) \
@IODEV_LIB_VAR@ @DISPLAY_LIB_VAR@ @HDIMAGE_LIB_VAR@ @USB_LIB_VAR@ @NETWORK_LIB_VAR@ @SOUND_LIB_VAR@ \
cpu/libcpu.a @AVX_LIB_VAR@ cpu/cpudb/libcpudb.a memory/libmemory.a gui/libgui.a \
@DEBUGGER_VAR@ @INSTRUMENT_VAR@ @PLUGIN_VAR@ \
@DEBUGGER_VAR@ @INSTRUMENT_VAR@ \
@GDBSTUB_VAR@ @FPU_VAR@
$(DLLTOOL) --dllname bochs.exe --def bochs.def --output-lib dllexports.a
$(DLLTOOL) --dllname bochs.exe --output-exp bochs.exp --def bochs.def

65
bochs/configure vendored
View File

@ -815,7 +815,6 @@ EXT_MSVC_DLL_RULES
PLUGIN_TARGET_2
PLUGIN_TARGET
PLUGIN_LIB
PLUGIN_VAR
IODEV_EXT_PLUGIN_OBJS
IODEV_EXT_NON_PLUGIN_OBJS
IODEV_PLUGIN_OBJS
@ -3805,8 +3804,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_config_headers="$ac_config_headers config.h"
ac_config_headers="$ac_config_headers ltdlconf.h"
VERSION="2.8.devel"
VER_MAJOR=2
@ -6170,7 +6167,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '#line 6173 "configure"' > conftest.$ac_ext
echo '#line 6170 "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
@ -7667,11 +7664,11 @@ else $as_nop
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7670: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7667: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:7674: \$? = $ac_status" >&5
echo "$as_me:7671: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -7901,11 +7898,11 @@ else $as_nop
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7904: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7901: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:7908: \$? = $ac_status" >&5
echo "$as_me:7905: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -7969,11 +7966,11 @@ else $as_nop
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7972: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7969: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:7976: \$? = $ac_status" >&5
echo "$as_me:7973: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -9764,7 +9761,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 9767 "configure"
#line 9764 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -9859,7 +9856,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 9862 "configure"
#line 9859 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -11977,11 +11974,11 @@ else $as_nop
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:11980: $lt_compile\"" >&5)
(eval echo "\"\$as_me:11977: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:11984: \$? = $ac_status" >&5
echo "$as_me:11981: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -12045,11 +12042,11 @@ else $as_nop
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:12048: $lt_compile\"" >&5)
(eval echo "\"\$as_me:12045: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:12052: \$? = $ac_status" >&5
echo "$as_me:12049: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -13068,7 +13065,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 13071 "configure"
#line 13068 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -13163,7 +13160,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 13166 "configure"
#line 13163 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -13983,11 +13980,11 @@ else $as_nop
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:13986: $lt_compile\"" >&5)
(eval echo "\"\$as_me:13983: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:13990: \$? = $ac_status" >&5
echo "$as_me:13987: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -14051,11 +14048,11 @@ else $as_nop
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:14054: $lt_compile\"" >&5)
(eval echo "\"\$as_me:14051: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:14058: \$? = $ac_status" >&5
echo "$as_me:14055: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -16019,11 +16016,11 @@ else $as_nop
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:16022: $lt_compile\"" >&5)
(eval echo "\"\$as_me:16019: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:16026: \$? = $ac_status" >&5
echo "$as_me:16023: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -16253,11 +16250,11 @@ else $as_nop
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:16256: $lt_compile\"" >&5)
(eval echo "\"\$as_me:16253: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:16260: \$? = $ac_status" >&5
echo "$as_me:16257: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -16321,11 +16318,11 @@ else $as_nop
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:16324: $lt_compile\"" >&5)
(eval echo "\"\$as_me:16321: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:16328: \$? = $ac_status" >&5
echo "$as_me:16325: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -18116,7 +18113,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 18119 "configure"
#line 18116 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -18211,7 +18208,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 18214 "configure"
#line 18211 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -19981,7 +19978,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 19984 "configure"
#line 19981 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -22814,8 +22811,7 @@ fi
printf "%s\n" "#define BX_HAVE_LTDL 1" >>confdefs.h
else
PLUGIN_VAR="ltdl.o"
PLUGIN_LIB="ltdl.o"
as_fn_error $? "Plugin support requires libltdl installed on your system" "$LINENO" 5
fi
fi
PLUGIN_TARGET=bochs_plugins
@ -26610,7 +26606,6 @@ case $target in
*-pc-windows* | *-pc-winnt*)
if test "$bx_plugins" = 1; then
# set variables for building DLL plugins
PLUGIN_VAR=""
PLUGIN_LIBNAME_TRANSFORMATION='%.o=bx_%.dll'
GUI_PLUGIN_NAME_TRANSFORMATION='%.o=bx_%_gui.dll'
IMG_PLUGIN_NAME_TRANSFORMATION='%.o=bx_%_img.dll'
@ -27552,7 +27547,6 @@ if test ! -d build/win32/nsis; then mkdir build/win32/nsis; fi
# Extract the first word of "gzip", so it can be a program name with args.
@ -28380,7 +28374,6 @@ for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"ltdlconf.h") CONFIG_HEADERS="$CONFIG_HEADERS ltdlconf.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"iodev/Makefile") CONFIG_FILES="$CONFIG_FILES iodev/Makefile" ;;
"iodev/display/Makefile") CONFIG_FILES="$CONFIG_FILES iodev/display/Makefile" ;;

View File

@ -5,7 +5,6 @@ AC_INIT
AC_CONFIG_SRCDIR([bochs.h])
AC_REVISION([[$Id$]])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_HEADERS([ltdlconf.h])
dnl // Put Bochs version information right here so that it gets substituted
dnl // into all the right places.
@ -466,8 +465,7 @@ if test "$bx_plugins" = 1; then
PLUGIN_LIB="-lltdl"
AC_DEFINE(BX_HAVE_LTDL,1)
else
PLUGIN_VAR="ltdl.o"
PLUGIN_LIB="ltdl.o"
AC_MSG_ERROR([Plugin support requires libltdl installed on your system])
fi
fi
PLUGIN_TARGET=bochs_plugins
@ -2974,7 +2972,6 @@ case $target in
*-pc-windows* | *-pc-winnt*)
if test "$bx_plugins" = 1; then
# set variables for building DLL plugins
PLUGIN_VAR=""
PLUGIN_LIBNAME_TRANSFORMATION='%.o=bx_%.dll'
GUI_PLUGIN_NAME_TRANSFORMATION='%.o=bx_%_gui.dll'
IMG_PLUGIN_NAME_TRANSFORMATION='%.o=bx_%_img.dll'
@ -3394,7 +3391,6 @@ AC_SUBST(IODEV_NON_PLUGIN_OBJS)
AC_SUBST(IODEV_PLUGIN_OBJS)
AC_SUBST(IODEV_EXT_NON_PLUGIN_OBJS)
AC_SUBST(IODEV_EXT_PLUGIN_OBJS)
AC_SUBST(PLUGIN_VAR)
AC_SUBST(PLUGIN_LIB)
AC_SUBST(PLUGIN_TARGET)
AC_SUBST(PLUGIN_TARGET_2)

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002-2021 The Bochs Project
// Copyright (C) 2002-2024 The Bochs Project
//
// extplugin.h
//
@ -23,7 +23,7 @@
#if BX_HAVE_LTDL
#include <ltdl.h>
#else
#include "ltdl-bochs.h"
#error Plugin support requires libltdl installed on your system
#endif
#endif

View File

@ -1,398 +0,0 @@
/////////////////////////////////////////////////////////////////////////
// $Id$
//
// NOTE: The ltdl library comes from the Libtool package. Bochs uses
// ltdl and libtool to build and load plugins. The libtool
// documentation describes how to copy ltdl.c and ltdl.h into your
// distribution, so it is clearly legal to do so.
/////////////////////////////////////////////////////////////////////////
/* ltdl.h -- generic dlopen functions
Copyright (C) 1998-2000 Free Software Foundation, Inc.
Originally by Thomas Tanner <tanner@ffii.org>
This file is part of GNU Libtool.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
As a special exception to the GNU Lesser General Public License,
if you distribute this file as part of a program or library that
is built using GNU libtool, you may include it under the same
distribution terms that you use for the rest of that program.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
*/
/* Only include this header file once. */
#ifndef LTDL_H
#define LTDL_H 1
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/types.h> /* for size_t declaration */
#ifdef __cplusplus
};
#endif
/* --- MACROS FOR PORTABILITY --- */
/* Saves on those hard to debug '\0' typos.... */
#define LT_EOS_CHAR '\0'
/* LTDL_BEGIN_C_DECLS should be used at the beginning of your declarations,
so that C++ compilers don't mangle their names. Use LTDL_END_C_DECLS at
the end of C declarations. */
#ifdef __cplusplus
# define LT_BEGIN_C_DECLS extern "C" {
# define LT_END_C_DECLS }
#else
# define LT_BEGIN_C_DECLS /* empty */
# define LT_END_C_DECLS /* empty */
#endif
LT_BEGIN_C_DECLS
/* LT_PARAMS is a macro used to wrap function prototypes, so that compilers
that don't understand ANSI C prototypes still work, and ANSI C
compilers can issue warnings about type mismatches. */
#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus)
# define LT_PARAMS(protos) protos
# define lt_ptr void*
#else
# define LT_PARAMS(protos) ()
# define lt_ptr char*
#endif
/* LT_STMT_START/END are used to create macros which expand to a
a single compound statement in a portable way. */
#if defined (__GNUC__) && !defined (__STRICT_ANSI__) && !defined (__cplusplus)
# define LT_STMT_START (void)(
# define LT_STMT_END )
#else
# if (defined (sun) || defined (__sun__))
# define LT_STMT_START if (1)
# define LT_STMT_END else (void)0
# else
# define LT_STMT_START do
# define LT_STMT_END while (0)
# endif
#endif
/* LT_CONC creates a new concatenated symbol for the compiler
in a portable way. */
#if defined(__STDC__) || defined(__cplusplus)
# define LT_CONC(s,t) s##t
#else
# define LT_CONC(s,t) s/**/t
#endif
/* LT_STRLEN can be used safely on NULL pointers. */
#define LT_STRLEN(s) (((s) && (s)[0]) ? strlen (s) : 0)
/* --- WINDOWS SUPPORT --- */
/* Canonicalise Windows and Cygwin recognition macros. */
#ifdef __CYGWIN32__
# ifndef __CYGWIN__
# define __CYGWIN__ __CYGWIN32__
# endif
#endif
#if defined(_WIN32) || defined(WIN32)
# ifndef __WINDOWS__
# ifdef _WIN32
# define __WINDOWS__ _WIN32
# else
# ifdef WIN32
# define __WINDOWS__ WIN32
# endif
# endif
# endif
#endif
#ifdef __WINDOWS__
# ifndef __CYGWIN__
/* LT_DIRSEP_CHAR is accepted *in addition* to '/' as a directory
separator when it is set. */
# define LT_DIRSEP_CHAR '\\'
# define LT_PATHSEP_CHAR ';'
# endif
#endif
#ifndef LT_PATHSEP_CHAR
# define LT_PATHSEP_CHAR ':'
#endif
/* DLL building support on win32 hosts; mostly to workaround their
ridiculous implementation of data symbol exporting. */
#ifndef LT_SCOPE
# ifdef __WINDOWS__
# ifdef DLL_EXPORT /* defined by libtool (if required) */
# define LT_SCOPE __declspec(dllexport)
# endif
# ifdef LIBLTDL_DLL_IMPORT /* define if linking with this dll */
# define LT_SCOPE extern __declspec(dllimport)
# endif
# endif
# ifndef LT_SCOPE /* static linking or !__WINDOWS__ */
# define LT_SCOPE extern
# endif
#endif
/* --- DYNAMIC MODULE LOADING API --- */
typedef struct lt_dlhandle_struct *lt_dlhandle; /* A loaded module. */
/* Initialisation and finalisation functions for libltdl. */
extern int lt_dlinit LT_PARAMS((void));
extern int lt_dlexit LT_PARAMS((void));
/* Module search path manipulation. */
extern int lt_dladdsearchdir LT_PARAMS((const char *search_dir));
extern int lt_dlinsertsearchdir LT_PARAMS((const char *before,
const char *search_dir));
extern int lt_dlsetsearchpath LT_PARAMS((const char *search_path));
extern const char *lt_dlgetsearchpath LT_PARAMS((void));
extern int lt_dlforeachfile LT_PARAMS((
const char *search_path,
int (*func) (const char *filename, lt_ptr data),
lt_ptr data));
/* Portable libltdl versions of the system dlopen() API. */
extern lt_dlhandle lt_dlopen LT_PARAMS((const char *filename));
extern lt_dlhandle lt_dlopenext LT_PARAMS((const char *filename));
extern lt_ptr lt_dlsym LT_PARAMS((lt_dlhandle handle,
const char *name));
extern const char *lt_dlerror LT_PARAMS((void));
extern int lt_dlclose LT_PARAMS((lt_dlhandle handle));
/* Module residency management. */
extern int lt_dlmakeresident LT_PARAMS((lt_dlhandle handle));
extern int lt_dlisresident LT_PARAMS((lt_dlhandle handle));
/* --- MUTEX LOCKING --- */
typedef void lt_dlmutex_lock LT_PARAMS((void));
typedef void lt_dlmutex_unlock LT_PARAMS((void));
typedef void lt_dlmutex_seterror LT_PARAMS((const char *errmsg));
typedef const char *lt_dlmutex_geterror LT_PARAMS((void));
extern int lt_dlmutex_register LT_PARAMS((lt_dlmutex_lock *lock,
lt_dlmutex_unlock *unlock,
lt_dlmutex_seterror *seterror,
lt_dlmutex_geterror *geterror));
/* --- MEMORY HANDLING --- */
/* By default, the realloc function pointer is set to our internal
realloc implementation which iself uses lt_dlmalloc and lt_dlfree.
libltdl relies on a featureful realloc, but if you are sure yours
has the right semantics then you can assign it directly. Generally,
it is safe to assign just a malloc() and a free() function. */
LT_SCOPE lt_ptr (*lt_dlmalloc) LT_PARAMS((size_t size));
LT_SCOPE lt_ptr (*lt_dlrealloc) LT_PARAMS((lt_ptr ptr, size_t size));
LT_SCOPE void (*lt_dlfree) LT_PARAMS((lt_ptr ptr));
/* --- PRELOADED MODULE SUPPORT --- */
/* A preopened symbol. Arrays of this type comprise the exported
symbols for a dlpreopened module. */
typedef struct {
const char *name;
lt_ptr address;
} lt_dlsymlist;
extern int lt_dlpreload LT_PARAMS((const lt_dlsymlist *preloaded));
extern int lt_dlpreload_default
LT_PARAMS((const lt_dlsymlist *preloaded));
#define LTDL_SET_PRELOADED_SYMBOLS() LT_STMT_START{ \
extern const lt_dlsymlist lt_preloaded_symbols[]; \
lt_dlpreload_default(lt_preloaded_symbols); \
}LT_STMT_END
/* --- MODULE INFORMATION --- */
/* Read only information pertaining to a loaded module. */
typedef struct {
char *filename; /* file name */
char *name; /* module name */
int ref_count; /* number of times lt_dlopened minus
number of times lt_dlclosed. */
} lt_dlinfo;
extern const lt_dlinfo *lt_dlgetinfo LT_PARAMS((lt_dlhandle handle));
extern lt_dlhandle lt_dlhandle_next LT_PARAMS((lt_dlhandle place));
extern int lt_dlforeach LT_PARAMS((
int (*func) (lt_dlhandle handle, lt_ptr data),
lt_ptr data));
/* Associating user data with loaded modules. */
typedef unsigned lt_dlcaller_id;
extern lt_dlcaller_id lt_dlcaller_register LT_PARAMS((void));
extern lt_ptr lt_dlcaller_set_data LT_PARAMS((lt_dlcaller_id key,
lt_dlhandle handle,
lt_ptr data));
extern lt_ptr lt_dlcaller_get_data LT_PARAMS((lt_dlcaller_id key,
lt_dlhandle handle));
/* --- USER MODULE LOADER API --- */
typedef struct lt_dlloader lt_dlloader;
typedef lt_ptr lt_user_data;
typedef lt_ptr lt_module;
/* Function pointer types for creating user defined module loaders. */
typedef lt_module lt_module_open LT_PARAMS((lt_user_data loader_data,
const char *filename));
typedef int lt_module_close LT_PARAMS((lt_user_data loader_data,
lt_module handle));
typedef lt_ptr lt_find_sym LT_PARAMS((lt_user_data loader_data,
lt_module handle,
const char *symbol));
typedef int lt_dlloader_exit LT_PARAMS((lt_user_data loader_data));
struct lt_user_dlloader {
const char *sym_prefix;
lt_module_open *module_open;
lt_module_close *module_close;
lt_find_sym *find_sym;
lt_dlloader_exit *dlloader_exit;
lt_user_data dlloader_data;
};
extern lt_dlloader *lt_dlloader_next LT_PARAMS((lt_dlloader *place));
extern lt_dlloader *lt_dlloader_find LT_PARAMS((
const char *loader_name));
extern const char *lt_dlloader_name LT_PARAMS((lt_dlloader *place));
extern lt_user_data *lt_dlloader_data LT_PARAMS((lt_dlloader *place));
extern int lt_dlloader_add LT_PARAMS((lt_dlloader *place,
const struct lt_user_dlloader *dlloader,
const char *loader_name));
extern int lt_dlloader_remove LT_PARAMS((
const char *loader_name));
/* --- ERROR MESSAGE HANDLING --- */
/* Bryce rewrote the error table in a way that would be likely to work
on all compilers. VC++ was not able to handle it the way it was
done originally. */
/* ORIG COMMENT: Defining error strings alongside their symbolic names in a
macro in this way allows us to expand the macro in different contexts with
confidence that the enumeration of symbolic names will map correctly
onto the table of error strings. */
#define lt_dlerror_symbols_list \
LT_ERROR_UNKNOWN, \
LT_ERROR_DLOPEN_NOT_SUPPORTED, \
LT_ERROR_INVALID_LOADER, \
LT_ERROR_INIT_LOADER, \
LT_ERROR_REMOVE_LOADER, \
LT_ERROR_FILE_NOT_FOUND, \
LT_ERROR_DEPLIB_NOT_FOUND, \
LT_ERROR_NO_SYMBOLS, \
LT_ERROR_CANNOT_OPEN, \
LT_ERROR_CANNOT_CLOSE, \
LT_ERROR_SYMBOL_NOT_FOUND, \
LT_ERROR_NO_MEMORY, \
LT_ERROR_INVALID_HANDLE, \
LT_ERROR_BUFFER_OVERFLOW, \
LT_ERROR_INVALID_ERRORCODE, \
LT_ERROR_SHUTDOWN, \
LT_ERROR_CLOSE_RESIDENT_MODULE, \
LT_ERROR_INVALID_MUTEX_ARGS, \
LT_ERROR_INVALID_POSITION,
#define lt_dlerror_names_list \
"unknown error", \
"dlopen support not available", \
"invalid loader", \
"loader initialization failed", \
"loader removal failed", \
"file not found", \
"dependency library not found", \
"no symbols defined", \
"can't open the module", \
"can't close the module", \
"symbol not found", \
"not enough memory", \
"invalid module handle", \
"internal buffer overflow", \
"invalid errorcode", \
"library already shutdown", \
"can't close resident module", \
"invalid mutex handler registration", \
"invalid search path insert position",
/* Enumerate the symbolic error names. */
enum {
lt_dlerror_symbols_list
LT_ERROR_MAX
};
/* These functions are only useful from inside custom module loaders. */
extern int lt_dladderror LT_PARAMS((const char *diagnostic));
extern int lt_dlseterror LT_PARAMS((int errorcode));
/* --- SOURCE COMPATIBILITY WITH OLD LIBLTDL --- */
#ifdef LT_NON_POSIX_NAMESPACE
# define lt_ptr_t lt_ptr
# define lt_module_t lt_module
# define lt_module_open_t lt_module_open
# define lt_module_close_t lt_module_close
# define lt_find_sym_t lt_find_sym
# define lt_dlloader_exit_t lt_dlloader_exit
# define lt_dlloader_t lt_dlloader
# define lt_dlloader_data_t lt_user_data
#endif
LT_END_C_DECLS
#endif /* !LTDL_H */

File diff suppressed because it is too large Load Diff

View File

@ -1,160 +0,0 @@
/////////////////////////////////////////////////////////////////////////
// $Id: ltdlconf.h.in,v 1.2 2002-10-24 21:04:38 bdenney Exp $
//
// The configure script reads this file and produces ltdlconf.h, which
// tells ltdl.c how to compile. It was copied out of the libtool package
// but appears to have been generated by autoheader.
/////////////////////////////////////////////////////////////////////////
/* config-h.in. Generated automatically from configure.in by autoheader. */
/* Define to empty if the keyword does not work. */
#undef const
/* Define as __inline if that's what the C compiler calls it. */
#undef inline
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define if you have the argz_append function. */
#undef HAVE_ARGZ_APPEND
/* Define if you have the argz_create_sep function. */
#undef HAVE_ARGZ_CREATE_SEP
/* Define if you have the argz_insert function. */
#undef HAVE_ARGZ_INSERT
/* Define if you have the argz_next function. */
#undef HAVE_ARGZ_NEXT
/* Define if you have the argz_stringify function. */
#undef HAVE_ARGZ_STRINGIFY
/* Define if you have the bcopy function. */
#undef HAVE_BCOPY
/* Define if you have the dlerror function. */
#undef HAVE_DLERROR
/* Define if you have the index function. */
#undef HAVE_INDEX
/* Define if you have the memcpy function. */
#undef HAVE_MEMCPY
/* Define if you have the memmove function. */
#undef HAVE_MEMMOVE
/* Define if you have the rindex function. */
#undef HAVE_RINDEX
/* Define if you have the strchr function. */
#undef HAVE_STRCHR
/* Define if you have the strcmp function. */
#undef HAVE_STRCMP
/* Define if you have the strrchr function. */
#undef HAVE_STRRCHR
/* Define if you have the <argz.h> header file. */
#undef HAVE_ARGZ_H
/* Define if you have the <assert.h> header file. */
#undef HAVE_ASSERT_H
/* Define if you have the <ctype.h> header file. */
#undef HAVE_CTYPE_H
/* Define if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
/* Define if you have the <dl.h> header file. */
#undef HAVE_DL_H
/* Define if you have the <dld.h> header file. */
#undef HAVE_DLD_H
/* Define if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
/* Define if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define if you have the <ndir.h> header file. */
#undef HAVE_NDIR_H
/* Define if you have the <stdio.h> header file. */
#undef HAVE_STDIO_H
/* Define if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define if you have the <sys/dir.h> header file. */
#undef HAVE_SYS_DIR_H
/* Define if you have the <sys/dl.h> header file. */
#undef HAVE_SYS_DL_H
/* Define if you have the <sys/ndir.h> header file. */
#undef HAVE_SYS_NDIR_H
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the extension used for shared libraries, say, .so. */
#undef LTDL_SHLIB_EXT
/* Define to the name of the environment variable that determines the dynamic library search path. */
#undef LTDL_SHLIBPATH_VAR
/* Define to the system default library search path. */
#undef LTDL_SYSSEARCHPATH
/* Define to the sub-directory in which libtool stores uninstalled libraries. */
#undef LTDL_OBJDIR
/* Define if libtool can extract symbol lists from object files. */
#undef HAVE_PRELOADED_SYMBOLS
/* Define if you have the libdl library or equivalent. */
#undef HAVE_LIBDL
/* Define if you have the libdl library or equivalent. */
#undef HAVE_LIBDL
/* Define if you have the libdl library or equivalent. */
#undef HAVE_LIBDL
/* Define if you have the shl_load function. */
#undef HAVE_SHL_LOAD
/* Define if you have the shl_load function. */
#undef HAVE_SHL_LOAD
/* Define if you have the GNU dld library. */
#undef HAVE_DLD
/* Define if dlsym() requires a leading underscode in symbol names. */
#undef NEED_USCORE
/* Define if the OS needs help to load dependent libraries for dlopen(). */
#undef LTDL_DLOPEN_DEPLIBS
/* Define to a type to use for `error_t' if it is not otherwise available. */
#undef error_t