[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: 81-gary-synch-from-CVS-libtool.patch
From: |
Gary V. Vaughan |
Subject: |
FYI: 81-gary-synch-from-CVS-libtool.patch |
Date: |
Tue, 18 Nov 2003 17:14:48 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20030925 Thunderbird/0.3 |
Applied to HEAD.
--
())_. Gary V. Vaughan gary@(lilith.warpmail.net|gnu.org)
( '/ Research Scientist http://www.oranda.demon.co.uk ,_())____
/ )= GNU Hacker http://www.gnu.org/software/libtool \' `&
`(_~)_ Tech' Author http://sources.redhat.com/autobook =`---d__/
Index: ChangeLog
from Gary V. Vaughan <address@hidden>
* gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
CVS libtool after merging m4 changes across to libtool.
Index: gnulib/acm4/libtool.m4
===================================================================
RCS file: /cvsroot/m4/m4/gnulib/acm4/libtool.m4,v
retrieving revision 1.2
diff -u -p -u -r1.2 libtool.m4
--- gnulib/acm4/libtool.m4 13 Nov 2003 12:05:57 -0000 1.2
+++ gnulib/acm4/libtool.m4 18 Nov 2003 17:09:34 -0000
@@ -46,15 +46,13 @@ AC_DEFUN([AC_PROG_LIBTOOL],
# ----------------
AC_DEFUN([_AC_PROG_LIBTOOL],
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_REQUIRE([_LT_PROG_LTMAIN])dnl
AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
# This can be used to rebuild libtool when needed
-for LIBTOOL_DEPS in "$ac_aux_dir/ltmain.sh" "config/ltmain.sh" "./ltmain.sh"
-do
- test -f "$LIBTOOL_DEPS" && break
-done
+LIBTOOL_DEPS="$ltmain"
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -65,6 +63,20 @@ define([AC_PROG_LIBTOOL], [])
])# _AC_PROG_LIBTOOL
+# _LT_PROG_LTMAIN
+# ---------------
+# In libtool itself `ltmain.sh' is in the build tree, but everything else
+# ships it in the source tree, for completeness, if we find a copy in the
+# build tree use that before falling back to auxdir.
+AC_DEFUN([_LT_PROG_LTMAIN],
+[case $ac_aux_dir in
+ $srcdir) ltmain=./ltmain.sh ;;
+ $srcdir/*) ltmain=`expr "$ac_aux_dir" : "$srcdir/\(.*\)"`/ltmain.sh ;;
+esac
+test -f "$ltmain" || ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
# AC_LIBTOOL_SETUP
# ----------------
AC_DEFUN([AC_LIBTOOL_SETUP],
@@ -207,7 +219,7 @@ test -z "$pic_mode" && pic_mode=default
# Use C for the default configuration in the libtool script
AC_LIBTOOL_LANG_C_CONFIG
_LT_AC_TAG_CONFIG
-dnl _LT_CONFIG_COMMANDS
+_LT_CONFIG_COMMANDS
])# AC_LIBTOOL_SETUP
@@ -257,8 +269,8 @@ _LT_CONFIG_LIBTOOL_INIT([$2])
# -------------------
# Send accumulated output to $CONFIG_STATUS.
m4_define([_LT_CONFIG_COMMANDS],
-[AC_CONFIG_COMMANDS([libtool-bogus],
- [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_INIT])
+[AC_CONFIG_COMMANDS([libtool],
+ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_INIT])
])
@@ -1488,6 +1500,12 @@ linux*)
# before this can be enabled.
hardcode_into_libs=yes
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g'
/etc/ld.so.conf`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
# We used to test for /lib/ld.so.1 and disable shared libraries on
# powerpc, because MkLinux only supported shared libraries with the
# GNU dynamic linker. Since this was broken with cross compilers,
@@ -1714,11 +1732,8 @@ m4_define([_LT_AC_TAG_CONFIG],
m4_exit(1)])
])
- AC_CONFIG_COMMANDS([libtool-tags], [
- for ltmain in "$ac_aux_dir/ltmain.sh" "config/ltmain.sh" "./ltmain.sh"
- do
- test -f "$ltmain" && break
- done
+ _LT_CONFIG_SAVE_COMMANDS([
+ _LT_PROG_LTMAIN
if test -f "$ltmain"; then
if test ! -f "${ofile}"; then
AC_MSG_ERROR([output file `$ofile' does not exist])
@@ -2051,6 +2066,7 @@ else
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_PROG_LD_GNU
+AC_SUBST([LD])
])# AC_PROG_LD
@@ -2321,6 +2337,7 @@ else
test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
fi])
NM="$lt_cv_path_NM"
+AC_SUBST([NM])
])# AC_PROG_NM
@@ -3820,7 +3837,7 @@ m4_define([_LT_CONFIG_STATUS_DECLARE],
# add code to config.status for appending the configuration named by
# TAGNAME from the matching tagged config vars.
m4_define([AC_LIBTOOL_CONFIG],
-[AC_CONFIG_COMMANDS([libtool]$1, [
+[_LT_CONFIG_SAVE_COMMANDS([
# See if we are running on zsh, and set the options which allow our
# commands through without removal of \ escapes.
if test -n "${ZSH_VERSION+set}" ; then
@@ -3830,11 +3847,9 @@ m4_define([AC_LIBTOOL_CONFIG],
m4_if([$1], [],
[cfgfile="${ofile}T"
trap "$rm \"$cfgfile\"; exit 1" 1 2 15
- $rm -f "$cfgfile"
- AC_MSG_NOTICE([creating $ofile])],
- [cfgfile="$ofile"
- AC_MSG_NOTICE([appending configuration tag `$1' to $ofile])
- ])
+ $rm -f "$cfgfile"],
+ [cfgfile="$ofile"]
+ )
cat <<_LT_EOF >> "$cfgfile"
m4_if([$1], [],
@@ -4199,14 +4214,7 @@ _LT_EOF
;;
esac
- # In libtool itself `ltmain.sh' is in the build tree, but everything else
- # ships it in the source tree, so we test for the general case first, but
- # have hardcoded special cases for building libtool and libltdl:
- for ltmain in "$ac_aux_dir/ltmain.sh" "config/ltmain.sh" "./ltmain.sh"
- do
- test -f "$ltmain" && break
- done
-
+ _LT_PROG_LTMAIN
# We use sed instead of cat because bash on DJGPP gets confused if
# if finds mixed CR/LF and LF-only lines. Since sed operates in
# text mode, it properly converts lines to CR/LF. This bash problem
@@ -5913,13 +5921,13 @@ m4_define([_LT_AC_TAGVAR], [m4_if([$2],
# old names
-AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
-AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
-AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
-AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
+AU_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+AU_DEFUN([AM_PROG_LD], [AC_PROG_LD])
+AU_DEFUN([AM_PROG_NM], [AC_PROG_NM])
# This is just to silence aclocal about the macro not being used
m4_if([AC_DISABLE_FAST_INSTALL])
@@ -5993,6 +6001,7 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xp
done
done
SED=$lt_cv_path_SED
+AC_SUBST([SED])
])
AC_MSG_RESULT([$SED])
])
Index: m4/ltdl.c
===================================================================
RCS file: /cvsroot/m4/m4/m4/ltdl.c,v
retrieving revision 1.16
diff -u -p -u -r1.16 ltdl.c
--- m4/ltdl.c 10 Sep 2003 17:12:02 -0000 1.16
+++ m4/ltdl.c 18 Nov 2003 17:09:35 -0000
@@ -29,11 +29,6 @@ Foundation, Inc., 59 Temple Place, Suite
# include <config.h>
#endif
-#if WITH_DMALLOC
-# undef malloc
-# undef realloc
-#endif
-
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
@@ -42,8 +37,14 @@ Foundation, Inc., 59 Temple Place, Suite
# include <stdio.h>
#endif
+/* Include the header defining malloc. On K&R C compilers,
+ that's <malloc.h>, on ANSI C and ISO C compilers, that's <stdlib.h>. */
#if HAVE_STDLIB_H
# include <stdlib.h>
+#else
+# if HAVE_MALLOC_H
+# include <malloc.h>
+# endif
#endif
#if HAVE_STRING_H
@@ -58,10 +59,6 @@ Foundation, Inc., 59 Temple Place, Suite
# include <ctype.h>
#endif
-#if HAVE_MALLOC_H
-# include <malloc.h>
-#endif
-
#if HAVE_MEMORY_H
# include <memory.h>
#endif
@@ -70,55 +67,6 @@ Foundation, Inc., 59 Temple Place, Suite
# include <errno.h>
#endif
-
-#ifndef __WINDOWS__
-# ifdef __WIN32__
-# define __WINDOWS__
-# endif
-#endif
-
-
-#undef LT_USE_POSIX_DIRENT
-#ifdef HAVE_CLOSEDIR
-# ifdef HAVE_OPENDIR
-# ifdef HAVE_READDIR
-# ifdef HAVE_DIRENT_H
-# define LT_USE_POSIX_DIRENT
-# endif /* HAVE_DIRENT_H */
-# endif /* HAVE_READDIR */
-# endif /* HAVE_OPENDIR */
-#endif /* HAVE_CLOSEDIR */
-
-
-#undef LT_USE_WINDOWS_DIRENT_EMULATION
-#ifndef LT_USE_POSIX_DIRENT
-# ifdef __WINDOWS__
-# define LT_USE_WINDOWS_DIRENT_EMULATION
-# endif /* __WINDOWS__ */
-#endif /* LT_USE_POSIX_DIRENT */
-
-
-#ifdef LT_USE_POSIX_DIRENT
-# include <dirent.h>
-# define LT_D_NAMLEN(dirent) (strlen((dirent)->d_name))
-#else
-# ifdef LT_USE_WINDOWS_DIRENT_EMULATION
-# define LT_D_NAMLEN(dirent) (strlen((dirent)->d_name))
-# else
-# define dirent direct
-# define LT_D_NAMLEN(dirent) ((dirent)->d_namlen)
-# if HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif
-# if HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif
-# if HAVE_NDIR_H
-# include <ndir.h>
-# endif
-# endif
-#endif
-
#if HAVE_ARGZ_H
# include <argz.h>
#endif
@@ -131,11 +79,37 @@ Foundation, Inc., 59 Temple Place, Suite
#include "ltdl.h"
+#if defined(HAVE_CLOSEDIR) && defined(HAVE_OPENDIR) && defined(HAVE_READDIR)
&& defined(HAVE_DIRENT_H)
+/* We have a fully operational dirent subsystem. */
+# include <dirent.h>
+# define LT_D_NAMLEN(dirent) (strlen((dirent)->d_name))
+
+#elif !defined(__WINDOWS__)
+/* We are not on windows, so we can get the same functionality from the
+ `direct' API. */
+# define dirent direct
+# define LT_D_NAMLEN(dirent) ((dirent)->d_namlen)
+# if HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+# include <ndir.h>
+# endif
+
+#else /* __WINDOWS__ */
+/* Use some wrapper code to emulate dirent on windows.. */
+# define LT_USE_WINDOWS_DIRENT_EMULATION
+#endif
+
#if WITH_DMALLOC
# include <dmalloc.h>
#endif
+
/* --- WINDOWS SUPPORT --- */
@@ -148,34 +122,12 @@ Foundation, Inc., 59 Temple Place, Suite
/* fopen() mode flags for reading a text file */
#undef LT_READTEXT_MODE
-#ifdef __WINDOWS__
+#if defined(__WINDOWS__) || defined(__CYGWIN__)
# define LT_READTEXT_MODE "rt"
#else
# define LT_READTEXT_MODE "r"
#endif
-#ifdef LT_USE_WINDOWS_DIRENT_EMULATION
-
-#include <windows.h>
-
-#define dirent lt_dirent
-#define DIR lt_DIR
-
-struct dirent
-{
- char d_name[2048];
- int d_namlen;
-};
-
-typedef struct _DIR
-{
- HANDLE hSearch;
- WIN32_FIND_DATA Win32FindData;
- BOOL firsttime;
- struct dirent file_info;
-} DIR;
-
-#endif /* LT_USE_WINDOWS_DIRENT_EMULATION */
/* --- MANIFEST CONSTANTS --- */
@@ -215,11 +167,14 @@ static char *lt_estrdup LT_PARAMS((con
static lt_ptr lt_emalloc LT_PARAMS((size_t size));
static lt_ptr lt_erealloc LT_PARAMS((lt_ptr addr, size_t size));
+/* static lt_ptr rpl_realloc LT_PARAMS((lt_ptr ptr, size_t size)); */
+#define rpl_realloc realloc
+
/* These are the pointers that can be changed by the caller: */
LT_GLOBAL_DATA lt_ptr (*lt_dlmalloc) LT_PARAMS((size_t size))
= (lt_ptr (*) LT_PARAMS((size_t))) malloc;
LT_GLOBAL_DATA lt_ptr (*lt_dlrealloc) LT_PARAMS((lt_ptr ptr, size_t size))
- = (lt_ptr (*) LT_PARAMS((lt_ptr, size_t))) realloc;
+ = (lt_ptr (*) LT_PARAMS((lt_ptr, size_t))) rpl_realloc;
LT_GLOBAL_DATA void (*lt_dlfree) LT_PARAMS((lt_ptr ptr))
= (void (*) LT_PARAMS((lt_ptr))) free;
@@ -426,17 +381,37 @@ memmove (dest, src, size)
#endif /* !HAVE_MEMMOVE */
-#ifdef LT_USE_WINDOWS_DIRENT_EMULATION
+# if LT_USE_WINDOWS_DIRENT_EMULATION
+
+# include <windows.h>
+
+# define LT_D_NAMLEN(dirent) (strlen((dirent)->d_name))
+# define dirent lt_dirent
+# define DIR lt_DIR
+
+struct dirent
+{
+ char d_name[2048];
+ int d_namlen;
+};
+
+typedef struct _DIR
+{
+ HANDLE hSearch;
+ WIN32_FIND_DATA Win32FindData;
+ BOOL firsttime;
+ struct dirent file_info;
+} DIR;
static void closedir LT_PARAMS((DIR *entry));
static void
-closedir(entry)
- DIR *entry;
+closedir (entry)
+ DIR *entry;
{
- assert(entry != (DIR *) NULL);
- FindClose(entry->hSearch);
- lt_dlfree((lt_ptr)entry);
+ assert (entry != (DIR *) NULL);
+ FindClose (entry->hSearch);
+ lt_dlfree ((lt_ptr) entry);
}
@@ -444,58 +419,65 @@ static DIR * opendir LT_PARAMS((const ch
static DIR*
opendir (path)
- const char *path;
+ const char *path;
{
char file_specification[LT_FILENAME_MAX];
DIR *entry;
- assert(path != (char *) NULL);
- (void) strncpy(file_specification,path,LT_FILENAME_MAX-1);
- (void) strcat(file_specification,"\\");
- entry = LT_DLMALLOC (DIR,sizeof(DIR));
+ assert (path != (char *) NULL);
+ (void) strncpy (file_specification, path, LT_FILENAME_MAX-1);
+ (void) strcat (file_specification, "\\");
+ entry = LT_DLMALLOC (DIR, sizeof(DIR));
if (entry != (DIR *) 0)
{
- entry->firsttime = true;
- entry->hSearch = FindFirstFile(file_specification,&entry->Win32FindData);
+ entry->firsttime = TRUE;
+ entry->hSearch = FindFirstFile (file_specification,
+ &entry->Win32FindData);
}
+
if (entry->hSearch == INVALID_HANDLE_VALUE)
{
- (void) strcat(file_specification,"\\*.*");
- entry->hSearch = FindFirstFile(file_specification,&entry->Win32FindData);
+ (void) strcat (file_specification, "\\*.*");
+ entry->hSearch = FindFirstFile (file_specification,
+ &entry->Win32FindData);
if (entry->hSearch == INVALID_HANDLE_VALUE)
{
LT_DLFREE (entry);
return (DIR *) 0;
}
}
- return(entry);
+
+ return entry;
}
static struct dirent *readdir LT_PARAMS((DIR *entry));
-static struct dirent *readdir(entry)
- DIR *entry;
+static struct dirent *
+readdir (entry)
+ DIR *entry;
{
- int
- status;
+ int status;
if (entry == (DIR *) 0)
- return((struct dirent *) 0);
+ return (struct dirent *) 0;
+
if (!entry->firsttime)
{
- status = FindNextFile(entry->hSearch,&entry->Win32FindData);
+ status = FindNextFile (entry->hSearch, &entry->Win32FindData);
if (status == 0)
- return((struct dirent *) 0);
+ return (struct dirent *) 0;
}
- entry->firsttime = false;
- (void) strncpy(entry->file_info.d_name,entry->Win32FindData.cFileName,
- LT_FILENAME_MAX-1);
- entry->file_info.d_namlen = strlen(entry->file_info.d_name);
- return(&entry->file_info);
+
+ entry->firsttime = FALSE;
+ (void) strncpy (entry->file_info.d_name, entry->Win32FindData.cFileName,
+ LT_FILENAME_MAX - 1);
+ entry->file_info.d_namlen = strlen (entry->file_info.d_name);
+
+ return &entry->file_info;
}
+#endif /* !LT_USE_WINDOWS_DIRENT_EMULATION */
-#endif /* LT_USE_WINDOWS_DIRENT_EMULATION */
/* According to Alexandre Oliva <address@hidden>,
``realloc is not entirely portable''
@@ -1017,7 +999,7 @@ lt_erealloc (addr, size)
lt_ptr addr;
size_t size;
{
- lt_ptr mem = realloc (addr, size);
+ lt_ptr mem = lt_dlrealloc (addr, size);
if (size && !mem)
LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY));
return mem;
@@ -1289,7 +1271,7 @@ static struct lt_user_dlloader sys_shl =
/* --- LOADLIBRARY() INTERFACE LOADER --- */
-#ifdef __WINDOWS__
+#if defined(__WINDOWS__) || defined(__CYGWIN__)
/* dynamic linking for Win32 */
@@ -1581,6 +1563,10 @@ static struct lt_user_dlloader sys_dld =
#if HAVE_MACH_O_DYLD_H
+#if !defined(__APPLE_CC__) && !defined(__MWERKS__) &&
!defined(__private_extern__)
+/* Is this correct? Does it still function properly? */
+#define __private_extern__ extern
+#endif
# include <mach-o/dyld.h>
#endif
#include <mach-o/getsect.h>
@@ -1588,11 +1574,11 @@ static struct lt_user_dlloader sys_dld =
/* We have to put some stuff here that isn't in older dyld.h files */
#ifndef ENUM_DYLD_BOOL
# define ENUM_DYLD_BOOL
-# undef false
-# undef true
+# undef FALSE
+# undef TRUE
enum DYLD_BOOL {
- false,
- true
+ FALSE,
+ TRUE
};
#endif
#ifndef LC_REQ_DYLD
@@ -1867,6 +1853,7 @@ sys_dyld_sym (loader_data, module, symbo
NSSymbol *nssym = 0;
void *unused;
const struct mach_header *mh=NULL;
+ char saveError[256] = "Symbol not found";
if (module == (lt_module)-1)
{
_dyld_lookup_and_bind(symbol,(unsigned long*)&address,&unused);
@@ -1897,12 +1884,14 @@ sys_dyld_sym (loader_data, module, symbo
}
if (!nssym)
{
+ strncpy(saveError,
lt_int_dyld_error(LT_DLSTRERROR(SYMBOL_NOT_FOUND)), 255);
+ saveError[255] = 0;
if (!mh) mh=lt_int_dyld_get_mach_header_from_nsmodule(module);
nssym = lt_int_dyld_NSlookupSymbolInLinkedLibs(symbol,mh);
}
if (!nssym)
{
- LT_DLMUTEX_SETERROR
(lt_int_dyld_error(LT_DLSTRERROR(SYMBOL_NOT_FOUND)));
+ LT_DLMUTEX_SETERROR (saveError);
return NULL;
}
return NSAddressOfSymbol(nssym);
@@ -2194,26 +2183,31 @@ lt_dlinit ()
handles = 0;
user_search_path = 0; /* empty search path */
-#if HAVE_LIBDL
- errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dl, "dlopen");
-#endif
-#if HAVE_SHL_LOAD
- errors += lt_dlloader_add (lt_dlloader_next (0), &sys_shl, "dlopen");
+ /* Append the available loaders to the internal list in the order
+ they should be used -- if the first fails, then try again with
+ the next loader in the chain. */
+# define LOADER_APPEND 0
+
+ errors += lt_dlloader_add (LOADER_APPEND, &presym, "dlpreload");
+#if HAVE_DLD
+ errors += lt_dlloader_add (LOADER_APPEND, &sys_dld, "dld");
#endif
-#ifdef __WINDOWS__
- errors += lt_dlloader_add (lt_dlloader_next (0), &sys_wll, "dlopen");
+#if HAVE_DYLD
+ errors += lt_dlloader_add (LOADER_APPEND, &sys_dyld, "dyld");
+ errors += sys_dyld_init();
#endif
#ifdef __BEOS__
- errors += lt_dlloader_add (lt_dlloader_next (0), &sys_bedl, "dlopen");
+ errors += lt_dlloader_add (LOADER_APPEND, &sys_bedl, "dlopen");
#endif
-#if HAVE_DLD
- errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dld, "dld");
+#if HAVE_SHL_LOAD
+ errors += lt_dlloader_add (LOADER_APPEND, &sys_shl, "dlopen");
#endif
-#if HAVE_DYLD
- errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dyld, "dyld");
- errors += sys_dyld_init();
+#if HAVE_LIBDL
+ errors += lt_dlloader_add (LOADER_APPEND, &sys_dl, "dlopen");
+#endif
+#if defined(__WINDOWS__) || defined(__CYGWIN__)
+ errors += lt_dlloader_add (LOADER_APPEND, &sys_wll, "dlopen");
#endif
- errors += lt_dlloader_add (lt_dlloader_next (0), &presym, "dlpreload");
if (presym_init (presym.dlloader_data))
{
@@ -3918,7 +3912,7 @@ lt_dlerror ()
LT_DLMUTEX_GETERROR (error);
LT_DLMUTEX_SETERROR (0);
- return error ? error : LT_DLSTRERROR (UNKNOWN);
+ return error ? error : NULL;
}
static int
@@ -4143,11 +4137,14 @@ lt_dlhandle_find (module_name)
lt_dlhandle cur = handles;
if (cur)
- do
- {
- if (cur->info.name && strcmp (cur->info.name, module_name) == 0)
- break;
- } while (cur = cur->next);
+ {
+ do
+ {
+ if (cur->info.name && strcmp (cur->info.name, module_name) == 0)
+ break;
+ }
+ while ((cur = cur->next));
+ }
return cur;
}
Index: m4/ltdl.h
===================================================================
RCS file: /cvsroot/m4/m4/m4/ltdl.h,v
retrieving revision 1.6
diff -u -p -u -r1.6 ltdl.h
--- m4/ltdl.h 12 Aug 2003 15:33:56 -0000 1.6
+++ m4/ltdl.h 18 Nov 2003 17:09:35 -0000
@@ -51,10 +51,61 @@ Software Foundation, Inc., 59 Temple Pla
LT_BEGIN_C_DECLS
+/* Canonicalise Windows and Cygwin recognition macros.
+ To match the values set by recent Cygwin compilers, make sure that if
+ __CYGWIN__ is defined (after canonicalisation), __WINDOWS__ is NOT! */
+#if defined(__CYGWIN32__) && !defined(__CYGWIN__)
+# define __CYGWIN__ __CYGWIN32__
+#endif
+#if defined(__CYGWIN__)
+# if defined(__WINDOWS__)
+# undef __WINDOWS__
+# endif
+#elif defined(_WIN32)
+# define __WINDOWS__ _WIN32
+#elif defined(WIN32)
+# define __WINDOWS__ WIN32
+#endif
+#if defined(__CYGWIN__) && defined(__WINDOWS__)
+# undef __WINDOWS__
+#endif
+
+
+#ifdef __WINDOWS__
+/* LT_DIRSEP_CHAR is accepted *in addition* to '/' as a directory
+ separator when it is set. */
+# define LT_DIRSEP_CHAR '\\'
+# define LT_PATHSEP_CHAR ';'
+#else
+# 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
+
+
+#if defined(_MSC_VER) /* Visual Studio */
+# define R_OK 4
+#endif
+
+
/* 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)
+#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined
(_SYSTYPE_SVR4)) || defined(__WINDOWS__) || defined(__cplusplus)
# define LT_PARAMS(protos) protos
# define lt_ptr void*
#else
@@ -79,7 +130,7 @@ LT_BEGIN_C_DECLS
/* LT_CONC creates a new concatenated symbol for the compiler
in a portable way. */
-#if defined(__STDC__) || defined(__cplusplus)
+#if defined(__STDC__) || defined(__cplusplus) || defined(_MSC_VER)
# define LT_CONC(s,t) s##t
#else
# define LT_CONC(s,t) s/**/t
@@ -90,89 +141,37 @@ LT_BEGIN_C_DECLS
-/* --- 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));
+LT_SCOPE int lt_dlinit LT_PARAMS((void));
+LT_SCOPE 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,
+LT_SCOPE int lt_dladdsearchdir LT_PARAMS((const char
*search_dir));
+LT_SCOPE 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((
+LT_SCOPE int lt_dlsetsearchpath LT_PARAMS((const char
*search_path));
+LT_SCOPE const char *lt_dlgetsearchpath LT_PARAMS((void));
+LT_SCOPE 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,
+LT_SCOPE lt_dlhandle lt_dlopen LT_PARAMS((const char
*filename));
+LT_SCOPE lt_dlhandle lt_dlopenext LT_PARAMS((const char
*filename));
+LT_SCOPE 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));
+LT_SCOPE const char *lt_dlerror LT_PARAMS((void));
+LT_SCOPE 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));
+LT_SCOPE int lt_dlmakeresident LT_PARAMS((lt_dlhandle handle));
+LT_SCOPE int lt_dlisresident LT_PARAMS((lt_dlhandle handle));
@@ -185,7 +184,7 @@ typedef void lt_dlmutex_unlock LT_PARAMS
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_SCOPE int lt_dlmutex_register LT_PARAMS((lt_dlmutex_lock
*lock,
lt_dlmutex_unlock *unlock,
lt_dlmutex_seterror *seterror,
lt_dlmutex_geterror *geterror));
@@ -218,8 +217,8 @@ typedef struct {
lt_ptr address;
} lt_dlsymlist;
-extern int lt_dlpreload LT_PARAMS((const lt_dlsymlist *preloaded));
-extern int lt_dlpreload_default
+LT_SCOPE int lt_dlpreload LT_PARAMS((const lt_dlsymlist
*preloaded));
+LT_SCOPE int lt_dlpreload_default
LT_PARAMS((const lt_dlsymlist *preloaded));
#define LTDL_SET_PRELOADED_SYMBOLS() LT_STMT_START{ \
@@ -241,22 +240,22 @@ typedef struct {
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 lt_dlhandle lt_dlhandle_find LT_PARAMS((
- const char *module_name));
-extern int lt_dlforeach LT_PARAMS((
+LT_SCOPE const lt_dlinfo *lt_dlgetinfo LT_PARAMS((lt_dlhandle
handle));
+LT_SCOPE lt_dlhandle lt_dlhandle_next LT_PARAMS((lt_dlhandle
place));
+LT_SCOPE lt_dlhandle lt_dlhandle_find LT_PARAMS((
+ const char
*module_name));
+LT_SCOPE 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_SCOPE lt_dlcaller_id lt_dlcaller_register LT_PARAMS((void));
+LT_SCOPE 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_SCOPE lt_ptr lt_dlcaller_get_data LT_PARAMS((lt_dlcaller_id
key,
lt_dlhandle handle));
@@ -287,15 +286,15 @@ struct lt_user_dlloader {
lt_user_data dlloader_data;
};
-extern lt_dlloader *lt_dlloader_next LT_PARAMS((lt_dlloader *place));
-extern lt_dlloader *lt_dlloader_find LT_PARAMS((
+LT_SCOPE lt_dlloader *lt_dlloader_next LT_PARAMS((lt_dlloader
*place));
+LT_SCOPE 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,
+LT_SCOPE const char *lt_dlloader_name LT_PARAMS((lt_dlloader
*place));
+LT_SCOPE lt_user_data *lt_dlloader_data LT_PARAMS((lt_dlloader
*place));
+LT_SCOPE 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((
+LT_SCOPE int lt_dlloader_remove LT_PARAMS((
const char *loader_name));
@@ -338,8 +337,8 @@ enum {
};
/* 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));
+LT_SCOPE int lt_dladderror LT_PARAMS((const char *diagnostic));
+LT_SCOPE int lt_dlseterror LT_PARAMS((int errorcode));
pgp4N3TZBQIoq.pgp
Description: PGP signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: 81-gary-synch-from-CVS-libtool.patch,
Gary V. Vaughan <=