]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
*** empty log message ***
authorThomas Tanner <tanner@gmx.de>
Fri, 25 Dec 1998 10:39:59 +0000 (10:39 +0000)
committerThomas Tanner <tanner@gmx.de>
Fri, 25 Dec 1998 10:39:59 +0000 (10:39 +0000)
ChangeLog
depdemo/.cvsignore
depdemo/configure.in
depdemo/sysdep.h
libltdl/Makefile.am
libltdl/configure.in
libltdl/ltdl.c
mdemo/Makefile.am

index f9c95be80e031c1db7e569fd52d1f52512fc014b..9895738bbe6ef96fe0894c62a4bd33cc4d0f40fb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+1998-12-25  Thomas Tanner  <tanner@gmx.de>
+
+       * depdemo/configure.in: removed last relics of demo
+       * depdemo/sysdep.h: ditto
+       * mdemo/Makefile.am: ditto
+       * libltdl/Makefile.am: fixed the version number, build libltdls if
+         -enable-install and -enable-dlpreopen are enabled
+       * libltdl/configure.in: libltdl is version 0.1, not 1.0,
+         renamed -enable-ltdl-install to -enable-install,
+         conditionals for libltdls, check for strchr and index,
+         replaced NULL with 0
+       * libltdl/ltdl.c: replaced NULL with 0, dlpreopen only if
+         USE_DLPREOPEN was defined, integrated shl_load code from GModule
+         (still untested)
+
 1998-12-24  Gary V. Vaughan  <gvaughan@oranda.demon.co.uk>
 
        * libltdl/configure.in: fixup spacing in --enable-ltdl-install
index 71b474bb264fcf6064f3679950bfe0e3cc8fa7e3..ac1ecd2d37a705af4001c2b69d6c7b5a4fee00fc 100644 (file)
@@ -7,5 +7,7 @@ configure
 config.*
 conftest*
 libtool
+*.lo
+*.la
 depdemo
 depdemo.static
index 03de5cf2be180ecd3777f7e93758d32e342a3a19..f1120a2a34dad69b7cc975bb702c3741f1197351 100644 (file)
@@ -1,4 +1,4 @@
-dnl Initialize the hell package.
+dnl Initialize the depdemo package.
 AC_INIT(main.c)
 AM_INIT_AUTOMAKE(depdemo,0.1)
 
index 797669db7825dd40bfa7bcb49794db020462255d..d1785564f20c2034229072bed758c8d5a495715e 100644 (file)
@@ -1,4 +1,4 @@
-/* foo.h -- interface to the libfoo* libraries
+/* sysdep.h -- system dependent declarations
    Copyright (C) 1998 Thomas Tanner <tanner@gmx.de>
    This file is part of GNU Libtool.
 
index 5347e5b96dd4e0f33427f8005c8723780bb7d849..c4dc80f6e0b4d4257b6edb01be03707756b76682 100644 (file)
@@ -1,27 +1,29 @@
 # A brief demonstration of using Automake with Libtool. -*-Makefile-*-
 #
-# NOTE: Don't forget that in the libtool distribution, files in this
-# directory are distributed by the demo_distfiles variable in the top
-# level Makefile.
 AUTOMAKE_OPTIONS = no-dependencies foreign
 
-LTDL_VERSION = -version-info 0:1:1
+LTDL_VERSION = -version-info 0:1:0
+
+ltdls.lo: ltdl.c
+       $(LTCOMPILE) -DUSE_DLPREOPEN -o $@ -c $<
+
+lib_LTLIBRARIES = @LIBLIBS@
+noinst_LTLIBRARIES = @NOINSTLIBS@
+EXTRA_LTLIBRARIES = libltdl.la libltdls.la
 
 if INSTALL_LTDL
-LTDL_FLAGS = $(LTDL_VERSION) -rpath $(libdir) 
+LTDL_FLAGS = $(LTDL_VERSION) -rpath $(libdir)
 include_HEADERS = ltdl.h
 else
 LTDL_FLAGS =
 noinst_HEADERS = ltdl.h
 endif
 
-EXTRA_LTLIBRARIES = libltdl.la
-
-lib_LTLIBRARIES = @LIBLIBS@
-noinst_LTLIBRARIES = @NOINSTLIBS@
-
-libltdl_la_SOURCES = ltdl.c
+libltdl_la_SOURCES = ltdl.c ltdl.h
 libltdl_la_LDFLAGS = $(LTDL_FLAGS) $(LIBADD_DL)
+libltdls_la_LIBADD = ltdls.lo
+libltdls_la_SOURCES = ltdl.h
+libltdls_la_LDFLAGS = $(LTDL_FLAGS) $(LIBADD_DL) 
 
 # rebuild the libtool script if needed
 ltdl.lo: libtool
index 71444e1a3e5baeb2a517d408a3f8f3009592242b..4a576f97967c3990225aa35bf70eaa89ccdbcc37 100644 (file)
@@ -1,14 +1,23 @@
 dnl Process this file with autoconf to create configure.
-dnl Initialize the ltdl package.
+dnl Initialize the libltdl package.
 AC_INIT(ltdl.c)
-AM_INIT_AUTOMAKE(libltdl,1.0)
+AM_INIT_AUTOMAKE(libltdl,0.1)
 
-AC_ARG_ENABLE(ltdl-install,
-  [  --enable-ltdl-install   install libltdl (breaks check before install)])
-AM_CONDITIONAL(INSTALL_LTDL, test x$enable_ltdl_install = xyes)
-if test x$enable_ltdl_install = xyes; then
+AC_ARG_ENABLE(install,
+  [  --enable-install        build installable version])
+AM_CONDITIONAL(INSTALL_LTDL, test x$enable_install = xyes)
+
+AC_ARG_ENABLE(dlpreopen,
+  [  --enable-dlpreopen      build installable version with dlpreopen support])
+
+dnl Always use dld_preloaded_symbols?
+always_dlpreopen=yes
+
+if test x$enable_install = xyes; then
   LIBLIBS=libltdl.la
+  test x$enable_dlpreopen = xyes && LIBLIBS="$LIBLIBS libltdls.la"
   NOINSTLIBS=
+  always_dlpreopen=no
 else
   LIBLIBS=
   NOINSTLIBS=libltdl.la
@@ -22,7 +31,7 @@ AM_PROG_LIBTOOL
 AC_HEADER_STDC
 AC_CHECK_HEADERS(malloc.h memory.h stdlib.h unistd.h stdio.h ctype.h dlfcn.h dl.h)
 AC_CHECK_HEADERS(string.h strings.h, break)
-AC_CHECK_FUNCS(strdup strrchr rindex)
+AC_CHECK_FUNCS(strdup strchr strrchr index rindex)
 
 AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
        libltdl_cv_dlpreopen, [dnl
@@ -49,7 +58,11 @@ AC_SUBST(LIBADD_DL)
 
 if test "$supported" = no; then
   AC_MSG_WARN(Can't find dlopen support: Please make sure that your programs use -dlopen/-dlpreopen.)
-  AC_DEFINE(DEBUG)
+  always_dlpreopen=yes
+fi
+
+if test "$always_dlpreopen" = yes; then
+  AC_DEFINE(USE_DLPREOPEN)
 fi
 
 AM_SYS_SYMBOL_UNDERSCORE
@@ -62,7 +75,7 @@ if test x"$USE_SYMBOL_UNDERSCORE" = xyes; then
 #include <dlfcn.h>
 #include <stdio.h>
 fnord() { int i=42;}
-main() { void *self, *ptr1, *ptr2; self=dlopen(NULL,RTLD_LAZY);
+main() { void *self, *ptr1, *ptr2; self=dlopen(0,RTLD_LAZY);
     if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
     if(ptr1 && !ptr2) exit(0); } exit(1); } 
 ],     libltdl_cv_need_uscore=no, libltdl_cv_need_uscore=yes,
index 46433da1df8a0880991c2dd70dac2cafa09cefc3..6325515a423961b8a4519732f1e55c3dcf616ed2 100644 (file)
@@ -62,7 +62,7 @@ typedef struct lt_dltype_t {
        lt_ptr_t (*find_sym) __P((lt_dlhandle handle, const char *symbol));
 } lt_dltype_t, *lt_dltype;
 
-#define LT_DLTYPE_TOP NULL
+#define LT_DLTYPE_TOP 0
 
 typedef        struct lt_dlhandle_t {
        struct lt_dlhandle_t *next;
@@ -115,7 +115,7 @@ strchr(str, ch)
        for (p = str; *p != (char)ch && p != '\0'; p++)
                /*NOWORK*/;
 
-       return (*p == (char)ch) ? p : NULL;
+       return (*p == (char)ch) ? p : 0;
 }
 
 # endif
@@ -145,7 +145,7 @@ strrchr(str, ch)
        while (*p != (char)ch && p >= str) 
                p--;
 
-       return (*p == (char)ch) ? p : NULL;
+       return (*p == (char)ch) ? p : 0;
 }
 
 # endif
@@ -224,6 +224,42 @@ dl = { LT_DLTYPE_TOP, dl_init, dl_exit,
 #include <dl.h>
 #endif
 
+/* the following lines are (c) Tim Janik */
+
+/* some flags are missing on some systems, so we provide
+ * harmless defaults.
+ *
+ * Mandatory:
+ * BIND_IMMEDIATE  - Resolve symbol references when the library is loaded.
+ * BIND_DEFERRED   - Delay code symbol resolution until actual reference.
+ *
+ * Optionally:
+ * BIND_FIRST     - Place the library at the head of the symbol search order.
+ * BIND_NONFATAL   - The default BIND_IMMEDIATE behavior is to treat all unsatisfied
+ *                  symbols as fatal.  This flag allows binding of unsatisfied code
+ *                  symbols to be deferred until use.
+ *                  [Perl: For certain libraries, like DCE, deferred binding often
+ *                  causes run time problems.  Adding BIND_NONFATAL to BIND_IMMEDIATE
+ *                  still allows unresolved references in situations like this.]
+ * BIND_NOSTART           - Do not call the initializer for the shared library when the
+ *                  library is loaded, nor on a future call to shl_unload().
+ * BIND_VERBOSE           - Print verbose messages concerning possible unsatisfied symbols.
+ *
+ * hp9000s700/hp9000s800:
+ * BIND_RESTRICTED - Restrict symbols visible by the library to those present at
+ *                  library load time.
+ * DYNAMIC_PATH           - Allow the loader to dynamically search for the library specified
+ *                  by the path argument.
+ */
+#ifndef        DYNAMIC_PATH
+#define        DYNAMIC_PATH    0
+#endif /* DYNAMIC_PATH */
+#ifndef        BIND_RESTRICTED
+#define        BIND_RESTRICTED 0
+#endif /* BIND_RESTRICTED */
+
+#define        OPT_BIND_FLAGS  (BIND_IMMEDIATE | BIND_NONFATAL | BIND_VERBOSE | DYNAMIC_PATH)
+
 static int
 shl_init ()       
 {
@@ -241,9 +277,8 @@ shl_open (handle, filename)
        lt_dlhandle handle;
        const char *filename;
 {
-       /* Probably too much BIND_* flags */
-       handle->handle = shl_load (filename, BIND_IMMEDIATE || BIND_FIRST ||
-               BIND_TOGETHER || BIND_VERBOSE || DYNAMIC_PATH, 0L);
+       handle->handle = shl_load (filename, OPT_BIND_FLAGS, 0L);
+       /* the hp-docs say we should better abort() if errno==ENOSYM ;( */
        return !(handle->handle);
 }
 
@@ -260,15 +295,12 @@ shl_sym (handle, symbol)
        lt_dlhandle handle;
        const char *symbol;
 {
-       int status, i;
-       struct shl_symbol *sym;
+       lt_ptr_t *sym;
 
-       status = shl_getsymbols((shl_t) (handle->handle), TYPE_PROCEDURE,
-                       EXPORT_SYMBOLS, malloc, &sym);
-       for (i = 0; i < status; i++)
-               if (strcmp(symbol, sym[i].name) == 0)
-                       return sym[i].value;
-       return 0;
+       if (shl_findsym ((shl_t) (handle->handle), symbol, 
+                       TYPE_UNDEFINED, &sym) || !(handle->handle) || !sym)
+               return 0;
+       return sym;
 }
 
 static
@@ -389,6 +421,7 @@ wll = { LT_DLTYPE_TOP, wll_init, wll_exit,
 #endif
 
 #if HAVE_DLPREOPEN
+#if USE_DLPREOPEN
 
 /* emulate dynamic linking using dld_preloaded_symbols */
 
@@ -463,6 +496,7 @@ dldpre = { LT_DLTYPE_TOP, dldpre_init, dldpre_exit,
 #undef LT_DLTYPE_TOP
 #define LT_DLTYPE_TOP &dldpre
 
+#endif
 #endif
 
 static lt_dlhandle handles;
index 10c322789e2318a644139bc8c98d20a10e8283c7..e7052884286a70609bcb8d7f92740e7d270d3bc7 100644 (file)
@@ -18,7 +18,7 @@ noinst_HEADERS = foo.h
 
 bin_PROGRAMS = mdemo mdemo.debug
 
-# Create a version of hell that does dlopen.
+# Create a version of mdemo that does dlopen.
 mdemo_SOURCES = main.c
 mdemo_LDADD = ../libltdl/libltdl.la \
        -lm # We won't need this when libltdl takes care of dependencies