]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libtool.m4: Updated comment.
authorOssama Othman <ossama@debian.org>
Tue, 13 Jun 2000 21:52:34 +0000 (21:52 +0000)
committerOssama Othman <ossama@debian.org>
Tue, 13 Jun 2000 21:52:34 +0000 (21:52 +0000)
* ltcf-cxx.sh (archive_cmds, archive_expsym_cmds,
hardcode_libdir_flag_spec, export_dynamic_flag_spec,
whole_archive_flag_spec, with_gnu_ld): Added two default
configurations for GNU g++ (one for g++ with GNU ld, and one for
g++ with native linker).  Updated all platform-specific g++
configurations to only be used if GNU ld isn't the backend linker.
Added support for the KCC (Kuck and Associates, Inc. (KAI) C++
Compiler) to the Linux and OSF/1 configurations.
(ac_cv_prog_cc_wl): Added KAI C++ configuration.
(archive_expsym_cmds): Some configurations were missing the
argument that sets the name of the output library.
* libltdl/ltdl.c, libltdl/libltdl.h: Synchronized with HEAD branch
versions.

* ltcf-cxx.sh (whole_archive_flag_spec): Added missing back quotes
(`) around a command that had to be evaluated.  This fixes GNU ld
"--whole-archive" support detection.
(wlarc): Fixed usage of $wlarc, which must be $wl in all cases,
but when really using $LD for linking.

* ltmain.in (deplibs): Add the library paths to end of the
deplibs, instead of the beginning, since deplibs is reordered
later on.

ChangeLog
libltdl/ltdl.c
libltdl/ltdl.h
libtool.m4
ltcf-cxx.sh
ltmain.in

index ad0e32bb839f2d69e5439727d8bd234168da9c9b..543ab5ab4cca0fdbe26148098fa76e19e7765634 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2000-06-10  Ossama Othman  <ossama@debian.org>
+
+       * libtool.m4: Updated comment.
+       * ltcf-cxx.sh (archive_cmds, archive_expsym_cmds,
+       hardcode_libdir_flag_spec, export_dynamic_flag_spec,
+       whole_archive_flag_spec, with_gnu_ld): Added two default
+       configurations for GNU g++ (one for g++ with GNU ld, and one for
+       g++ with native linker).  Updated all platform-specific g++
+       configurations to only be used if GNU ld isn't the backend linker.
+       Added support for the KCC (Kuck and Associates, Inc. (KAI) C++
+       Compiler) to the Linux and OSF/1 configurations.
+       (ac_cv_prog_cc_wl): Added KAI C++ configuration.
+       (archive_expsym_cmds): Some configurations were missing the
+       argument that sets the name of the output library.
+       * libltdl/ltdl.c, libltdl/libltdl.h: Synchronized with HEAD branch
+       versions.
+
+2000-06-10  Michael Matz  <matz@ifh.de>
+
+       * ltcf-cxx.sh (whole_archive_flag_spec): Added missing back quotes
+       (`) around a command that had to be evaluated.  This fixes GNU ld
+       "--whole-archive" support detection.
+       (wlarc): Fixed usage of $wlarc, which must be $wl in all cases,
+       but when really using $LD for linking.
+
+2000-06-10  Stephan Kulow  <coolo@kde.org>
+       * ltmain.in (deplibs): Add the library paths to end of the
+       deplibs, instead of the beginning, since deplibs is reordered
+       later on.
+
 2000-06-05  Ossama Othman  <ossama@debian.org>
 
        * ltcf-cxx.sh (compiler_lib_search_path), ltconfig.in
index a433d264a0e12d641bb9b95ad88cae3da6993371..134fbab36407afd7541eebaa699cd710e2a371eb 100644 (file)
@@ -4,24 +4,25 @@
    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 Library General Public
+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 Library General Public License,
-if you distribute this file as part of a program that uses GNU libtool
-to create libraries and programs, you may include it under the same
+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
-Library General Public License for more details.
+Lesser General Public License for more details.
 
-You should have received a copy of the GNU Library General Public
+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., 59 Temple Place, Suite 330, Boston, MA
 02111-1307  USA
+
 */
 
 #define _LTDL_COMPILE_
@@ -93,10 +94,11 @@ struct lt_dlloader_t {
        struct lt_dlloader_t *next;
        const char *loader_name; /* identifying name for each loader */
        const char *sym_prefix;  /* prefix for symbols */
-       lt_dlloader_exit_t *dlloader_exit;
        lt_module_open_t *module_open;
        lt_module_close_t *module_close;
        lt_find_sym_t *find_sym;
+       lt_dlloader_exit_t *dlloader_exit;
+       lt_dlloader_data_t dlloader_data;
 };
 
 typedef        struct lt_dlhandle_t {
@@ -283,7 +285,8 @@ strrchr(str, ch)
 #endif
 
 static lt_module_t
-sys_dl_open (filename)
+sys_dl_open (loader_data, filename)
+       lt_dlloader_data_t loader_data;
        const char *filename;
 {
        lt_module_t module = dlopen(filename, LTDL_GLOBAL | LTDL_LAZY_OR_NOW);
@@ -298,7 +301,8 @@ sys_dl_open (filename)
 }
 
 static int
-sys_dl_close (module)
+sys_dl_close (loader_data, module)
+       lt_dlloader_data_t loader_data;
        lt_module_t module;
 {
        if (dlclose(module) != 0) {
@@ -313,7 +317,8 @@ sys_dl_close (module)
 }
 
 static lt_ptr_t
-sys_dl_sym (module, symbol)
+sys_dl_sym (loader_data, module, symbol)
+       lt_dlloader_data_t loader_data;
        lt_module_t module;
        const char *symbol;
 {
@@ -334,7 +339,7 @@ static struct lt_user_dlloader sys_dl = {
 #  else
           0,
 #  endif
-          sys_dl_open, sys_dl_close, sys_dl_sym, 0 };
+          sys_dl_open, sys_dl_close, sys_dl_sym, 0, 0 };
 #endif
 
 #if HAVE_SHL_LOAD
@@ -381,7 +386,8 @@ static struct lt_user_dlloader sys_dl = {
 #define        LTDL_BIND_FLAGS (BIND_IMMEDIATE | BIND_NONFATAL | DYNAMIC_PATH)
 
 static lt_module_t
-sys_shl_open (filename)
+sys_shl_open (loader_data, filename)
+       lt_dlloader_data_t loader_data;
        const char *filename;
 {
        lt_module_t module = shl_load(filename, LTDL_BIND_FLAGS, 0L);
@@ -392,7 +398,8 @@ sys_shl_open (filename)
 }
 
 static int
-sys_shl_close (module)
+sys_shl_close (loader_data, module)
+       lt_dlloader_data_t loader_data;
        lt_module_t module;
 {
        if (shl_unload((shl_t) (module)) != 0) {
@@ -403,7 +410,8 @@ sys_shl_close (module)
 }
 
 static lt_ptr_t
-sys_shl_sym (module, symbol)
+sys_shl_sym (loader_data, module, symbol)
+       lt_dlloader_data_t loader_data;
        lt_module_t module;
        const char *symbol;
 {
@@ -418,7 +426,7 @@ sys_shl_sym (module, symbol)
 }
 
 static struct lt_user_dlloader
-sys_shl = { 0, sys_shl_open, sys_shl_close, sys_shl_sym, 0 };
+sys_shl = { 0, sys_shl_open, sys_shl_close, sys_shl_sym, 0, 0 };
 
 #undef LTDL_TYPE_TOP
 #define LTDL_TYPE_TOP &sys_shl
@@ -435,13 +443,23 @@ sys_shl = { 0, sys_shl_open, sys_shl_close, sys_shl_sym, 0 };
 static lt_dlhandle handles;
 
 static lt_module_t
-sys_wll_open (filename)
+sys_wll_open (loader_data, filename)
+       lt_dlloader_data_t loader_data;
        const char *filename;
 {
        lt_dlhandle cur;
        lt_module_t module;
        char *searchname = 0;
-       char *ext = strrchr(filename, '.');
+        char *ext;
+        char self_name_buf[MAX_PATH];
+
+       if (!filename) {
+               /* Get the name of main module */
+               *self_name_buf = 0;
+               GetModuleFileName(NULL, self_name_buf, sizeof(self_name_buf));
+               filename = ext = self_name_buf;
+       }
+       else ext = strrchr(filename, '.');
 
        if (ext) {
                /* FILENAME already has an extension. */
@@ -489,7 +507,8 @@ sys_wll_open (filename)
 }
 
 static int
-sys_wll_close (module)
+sys_wll_close (loader_data, module)
+       lt_dlloader_data_t loader_data;
        lt_module_t module;
 {
        if (FreeLibrary(module) == 0) {
@@ -500,7 +519,8 @@ sys_wll_close (module)
 }
 
 static lt_ptr_t
-sys_wll_sym (module, symbol)
+sys_wll_sym (loader_data, module, symbol)
+       lt_dlloader_data_t loader_data;
        lt_module_t module;
        const char *symbol;
 {
@@ -512,7 +532,7 @@ sys_wll_sym (module, symbol)
 }
 
 static struct lt_user_dlloader
-sys_wll = { 0, sys_wll_open, sys_wll_close, sys_wll_sym, 0 };
+sys_wll = { 0, sys_wll_open, sys_wll_close, sys_wll_sym, 0, 0 };
 
 #endif
 
@@ -523,7 +543,8 @@ sys_wll = { 0, sys_wll_open, sys_wll_close, sys_wll_sym, 0 };
 #include <kernel/image.h>
 
 static lt_module_t
-sys_bedl_open (filename)
+sys_bedl_open (loader_data, filename)
+       lt_dlloader_data_t loader_data;
        const char *filename;
 {
        image_id image = 0;
@@ -545,7 +566,8 @@ sys_bedl_open (filename)
 }
 
 static int
-sys_bedl_close (module)
+sys_bedl_close (loader_data, module)
+       lt_dlloader_data_t loader_data;
        lt_module_t module;
 {
        if (unload_add_on((image_id)module) != B_OK) {
@@ -556,7 +578,8 @@ sys_bedl_close (module)
 }
 
 static lt_ptr_t
-sys_bedl_sym (module, symbol)
+sys_bedl_sym (loader_data, module, symbol)
+       lt_dlloader_data_t loader_data;
        lt_module_t module;
        const char *symbol;
 {
@@ -572,7 +595,7 @@ sys_bedl_sym (module, symbol)
 }
 
 static struct lt_user_dlloader
-sys_bedl = { 0, sys_bedl_open, sys_bedl_close, sys_bedl_sym, 0 };
+sys_bedl = { 0, sys_bedl_open, sys_bedl_close, sys_bedl_sym, 0, 0 };
 
 #endif
 
@@ -585,7 +608,8 @@ sys_bedl = { 0, sys_bedl_open, sys_bedl_close, sys_bedl_sym, 0 };
 #endif
 
 static lt_module_t
-sys_dld_open (filename)
+sys_dld_open (loader_data, filename)
+       lt_dlloader_data_t loader_data;
        const char *filename;
 {
        lt_module_t module = strdup(filename);
@@ -602,7 +626,8 @@ sys_dld_open (filename)
 }
 
 static int
-sys_dld_close (module)
+sys_dld_close (loader_data, module)
+       lt_dlloader_data_t loader_data;
        lt_module_t module;
 {
        if (dld_unlink_by_file((char*)(module), 1) != 0) {
@@ -614,7 +639,8 @@ sys_dld_close (module)
 }
 
 static lt_ptr_t
-sys_dld_sym (module, symbol)
+sys_dld_sym (loader_data, module, symbol)
+       lt_dlloader_data_t loader_data;
        lt_module_t module;
        const char *symbol;
 {
@@ -626,7 +652,7 @@ sys_dld_sym (module, symbol)
 }
 
 static struct lt_user_dlloader
-sys_dld = { 0, sys_dld_open, sys_dld_close, sys_dld_sym, 0 };
+sys_dld = { 0, sys_dld_open, sys_dld_close, sys_dld_sym, 0, 0 };
 
 #endif
 
@@ -641,7 +667,8 @@ static const lt_dlsymlist *default_preloaded_symbols = 0;
 static lt_dlsymlists_t *preloaded_symbols = 0;
 
 static int
-presym_init LTDL_PARAMS((void))
+presym_init (loader_data)
+       lt_dlloader_data_t loader_data;
 {
        preloaded_symbols = 0;
        if (default_preloaded_symbols)
@@ -665,7 +692,8 @@ presym_free_symlists LTDL_PARAMS((void))
 }
 
 static int
-presym_exit LTDL_PARAMS((void))
+presym_exit (loader_data)
+       lt_dlloader_data_t loader_data;
 {
        presym_free_symlists();
        return 0;
@@ -696,7 +724,8 @@ presym_add_symlist (preloaded)
 }
 
 static lt_module_t
-presym_open (filename)
+presym_open (loader_data, filename)
+       lt_dlloader_data_t loader_data;
        const char *filename;
 {
        lt_dlsymlists_t *lists = preloaded_symbols;
@@ -724,7 +753,8 @@ presym_open (filename)
 }
 
 static int
-presym_close (module)
+presym_close (loader_data, module)
+       lt_dlloader_data_t loader_data;
        lt_module_t module;
 {
        /* Just to silence gcc -Wall */
@@ -733,7 +763,8 @@ presym_close (module)
 }
 
 static lt_ptr_t
-presym_sym (module, symbol)
+presym_sym (loader_data, module, symbol)
+       lt_dlloader_data_t loader_data;
        lt_module_t module;
        const char *symbol;
 {
@@ -750,7 +781,7 @@ presym_sym (module, symbol)
 }
 
 static struct lt_user_dlloader
-presym = { 0, presym_open, presym_close, presym_sym, presym_exit };
+presym = { 0, presym_open, presym_close, presym_sym, presym_exit, 0 };
 
 
 static char *user_search_path = 0;
@@ -762,7 +793,6 @@ int
 lt_dlinit LTDL_PARAMS((void))
 {
        /* initialize libltdl */
-       lt_dlloader_t **loader = &loaders;
        int errors = 0;
 
        if (initialized) {      /* Initialize only at first call. */
@@ -773,25 +803,25 @@ lt_dlinit LTDL_PARAMS((void))
        user_search_path = 0; /* empty search path */
        
 #if HAVE_LIBDL && !defined(__CYGWIN__)
-       errors += lt_add_dlloader (lt_next_dlloader(0), &sys_dl, "dlopen");
+       errors += lt_dlloader_add (lt_dlloader_next(0), &sys_dl, "dlopen");
 #endif 
 #if HAVE_SHL_LOAD
-       errors += lt_add_dlloader (lt_next_dlloader(0), &sys_shl, "dlopen");
+       errors += lt_dlloader_add (lt_dlloader_next(0), &sys_shl, "dlopen");
 #endif
 #ifdef _WIN32
-       errors += lt_add_dlloader (lt_next_dlloader(0), &sys_wll, "dlopen");
+       errors += lt_dlloader_add (lt_dlloader_next(0), &sys_wll, "dlopen");
 #endif
 #ifdef __BEOS__
-       errors += lt_add_dlloader (lt_next_dlloader(0), &sys_bedl, "dlopen");
+       errors += lt_dlloader_add (lt_dlloader_next(0), &sys_bedl, "dlopen");
 #endif
 #if HAVE_DLD
-       errors += lt_add_dlloader (lt_next_dlloader(0), &sys_dld, "dld");
+       errors += lt_dlloader_add (lt_dlloader_next(0), &sys_dld, "dld");
 #endif
-       errors += lt_add_dlloader (lt_next_dlloader(0), &presym, "dlpreload");
-       if (presym_init()) {
+       errors += lt_dlloader_add (lt_dlloader_next(0), &presym, "dlpreload");
+       if (presym_init(presym.dlloader_data)) {
                last_error = LT_DLSTRERROR(INIT_LOADER);
                        return 1;
-               }
+       }
 
        if (errors != 0) {
                last_error = LT_DLSTRERROR(DLOPEN_NOT_SUPPORTED);
@@ -852,7 +882,8 @@ lt_dlexit LTDL_PARAMS((void))
        /* close all loaders */
        while (loader) {
                lt_dlloader_t *next = loader->next;
-               if (loader->dlloader_exit && loader->dlloader_exit())
+               lt_dlloader_data_t data = loader->dlloader_data;
+               if (loader->dlloader_exit && loader->dlloader_exit(data))
                        errors++;
                lt_dlfree (loader);
                loader = next;
@@ -867,12 +898,11 @@ tryall_dlopen (handle, filename)
        lt_dlhandle *handle;
        const char *filename;
 {
-       lt_dlhandle cur;
+       lt_dlhandle cur = handles;
        lt_dlloader_t *loader = loaders;
        const char *saved_error = last_error;
        
        /* check whether the module was already opened */
-       cur = handles;
        while (cur) {
                /* try to dlopen the program itself? */
                if (!cur->info.filename && !filename)
@@ -882,6 +912,7 @@ tryall_dlopen (handle, filename)
                        break;
                cur = cur->next;
        }
+
        if (cur) {
                cur->info.ref_count++;
                *handle = cur;
@@ -898,7 +929,8 @@ tryall_dlopen (handle, filename)
        } else
                cur->info.filename = 0;
        while (loader) {
-               cur->module = loader->module_open(filename);
+               lt_dlloader_data_t data = loader->dlloader_data;
+               cur->module = loader->module_open(data, filename);
                if (cur->module != 0)
                        break;
                loader = loader->next;
@@ -1579,12 +1611,13 @@ lt_dlclose (handle)
        handle->info.ref_count--;
        if (!handle->info.ref_count) {
                int     error;
+               lt_dlloader_data_t data = handle->loader->dlloader_data;
        
                if (handle != handles)
                        last->next = handle->next;
                else
                        handles = handle->next;
-               error = handle->loader->module_close(handle->module);
+               error = handle->loader->module_close(data, handle->module);
                error += unload_deplibs(handle);
                if (handle->info.filename)
                        lt_dlfree(handle->info.filename);
@@ -1605,6 +1638,7 @@ lt_dlsym (handle, symbol)
        char    lsym[LTDL_SYMBOL_LENGTH];
        char    *sym;
        lt_ptr_t address;
+       lt_dlloader_data_t data;
 
        if (!handle) {
                last_error = LT_DLSTRERROR(INVALID_HANDLE);
@@ -1627,6 +1661,7 @@ lt_dlsym (handle, symbol)
                last_error = LT_DLSTRERROR(BUFFER_OVERFLOW);
                return 0;
        }
+       data = handle->loader->dlloader_data;
        if (handle->info.name) {
                const char *saved_error = last_error;
                
@@ -1639,7 +1674,7 @@ lt_dlsym (handle, symbol)
                strcat(sym, "_LTX_");
                strcat(sym, symbol);
                /* try "modulename_LTX_symbol" */
-               address = handle->loader->find_sym(handle->module, sym);
+               address = handle->loader->find_sym(data, handle->module, sym);
                if (address) {
                        if (sym != lsym)
                                lt_dlfree(sym);
@@ -1653,7 +1688,7 @@ lt_dlsym (handle, symbol)
                strcat(sym, symbol);
        } else
                strcpy(sym, symbol);
-       address = handle->loader->find_sym(handle->module, sym);
+       address = handle->loader->find_sym(data, handle->module, sym);
        if (sym != lsym)
                lt_dlfree(sym);
        return address;
@@ -1743,9 +1778,8 @@ lt_dlforeach (func, data)
        return 0;
 }
 
-\f
 int
-lt_add_dlloader (place, dlloader, loader_name)
+lt_dlloader_add (place, dlloader, loader_name)
        lt_dlloader_t *place;
        const struct lt_user_dlloader *dlloader;
        const char *loader_name;
@@ -1773,6 +1807,7 @@ lt_add_dlloader (place, dlloader, loader_name)
        node->module_open = dlloader->module_open;
        node->module_close = dlloader->module_close;
        node->find_sym = dlloader->find_sym;
+       node->dlloader_data = dlloader->dlloader_data;
        
        if (!loaders)
                /* If there are no loaders, NODE becomes the list! */
@@ -1806,10 +1841,10 @@ lt_add_dlloader (place, dlloader, loader_name)
 }
 
 int
-lt_remove_dlloader (loader_name)
+lt_dlloader_remove (loader_name)
        const char *loader_name;
 {
-       lt_dlloader_t *place = lt_find_dlloader (loader_name);
+       lt_dlloader_t *place = lt_dlloader_find (loader_name);
        lt_dlhandle handle;
        int result = 0;
 
@@ -1820,7 +1855,7 @@ lt_remove_dlloader (loader_name)
 
        /* Fail if there are any open modules which use this loader. */
        for  (handle = handles; handle; handle = handle->next)
-               if (handle->loader = place) {
+               if (handle->loader == place) {
                        last_error = LT_DLSTRERROR(REMOVE_LOADER);
                        return 1;
                }
@@ -1839,14 +1874,14 @@ lt_remove_dlloader (loader_name)
                prev->next = prev->next->next;
        }
        if (place->dlloader_exit)
-               result = place->dlloader_exit ();
+               result = place->dlloader_exit (place->dlloader_data);
        lt_dlfree (place);
 
        return result;
 }
 
 lt_dlloader_t *
-lt_next_dlloader (place)
+lt_dlloader_next (place)
        lt_dlloader_t *place;
 {
        return place ? place->next : loaders;
@@ -1861,8 +1896,17 @@ lt_dlloader_name (place)
        return place ? place->loader_name : 0;
 }      
 
+lt_dlloader_data_t *
+lt_dlloader_data (place)
+       lt_dlloader_t *place;
+{
+       if (!place)
+               last_error =  LT_DLSTRERROR(INVALID_LOADER);
+       return place ? &(place->dlloader_data) : 0;
+}      
+
 lt_dlloader_t *
-lt_find_dlloader (loader_name)
+lt_dlloader_find (loader_name)
        const char *loader_name;
 {
        lt_dlloader_t *place = 0;
@@ -1874,7 +1918,6 @@ lt_find_dlloader (loader_name)
        return place;
 }
 
-\f
 static const char **user_error_strings = 0;
 static int errorcode = LTDL_ERROR_MAX;
 
index 605f72774ce60f6cf5491c5b6fdece3efd9297b7..96e076faa75b1784966faf93d2f67fe684d40f85 100644 (file)
@@ -4,21 +4,21 @@
    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 Library General Public
+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 Library General Public License,
-if you distribute this file as part of a program that uses GNU libtool
-to create libraries and programs, you may include it under the same
+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
-Library General Public License for more details.
+Lesser General Public License for more details.
 
-You should have received a copy of the GNU Library General Public
+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., 59 Temple Place, Suite 330, Boston, MA
 02111-1307  USA
@@ -113,7 +113,6 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
 #include <stdlib.h>
 
-\f
 /* 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
@@ -148,7 +147,6 @@ enum {
 };
 #undef LTDL_ERROR
 
-\f
 /* An opaque handle for a successfully lt_dlopened module instance. */
 #ifdef _LTDL_COMPILE_
 typedef        struct lt_dlhandle_t *lt_dlhandle;
@@ -182,11 +180,13 @@ typedef   struct lt_dlloader_t lt_dlloader_t;
 typedef        lt_ptr_t lt_dlloader_t;
 #endif
 
+typedef lt_ptr_t lt_dlloader_data_t;
+
 /* Function pointer types for creating user defined module loaders. */
-typedef lt_module_t lt_module_open_t LTDL_PARAMS((const char *filename));
-typedef int lt_module_close_t LTDL_PARAMS((lt_module_t handle));
-typedef lt_ptr_t lt_find_sym_t LTDL_PARAMS((lt_module_t handle, const char *symbol));
-typedef int lt_dlloader_exit_t LTDL_PARAMS((void));
+typedef lt_module_t lt_module_open_t LTDL_PARAMS((lt_dlloader_data_t loader_data, const char *filename));
+typedef int lt_module_close_t LTDL_PARAMS((lt_dlloader_data_t loader_data, lt_module_t handle));
+typedef lt_ptr_t lt_find_sym_t LTDL_PARAMS((lt_dlloader_data_t loader_data, lt_module_t handle, const char *symbol));
+typedef int lt_dlloader_exit_t LTDL_PARAMS((lt_dlloader_data_t loader_data));
 
 __BEGIN_DECLS
 /* Initialisation and finalisation functions for libltdl. */
@@ -219,7 +219,6 @@ extern const lt_dlinfo *lt_dlgetinfo LTDL_PARAMS((lt_dlhandle handle));
 extern int lt_dlforeach LTDL_PARAMS((
                int (*func)(lt_dlhandle handle, lt_ptr_t data), lt_ptr_t data));
 
-\f
 /* User module loader API. */
 struct lt_user_dlloader {
        const char *sym_prefix;
@@ -227,12 +226,16 @@ struct lt_user_dlloader {
        lt_module_close_t *module_close;
        lt_find_sym_t *find_sym;
        lt_dlloader_exit_t *dlloader_exit;
+       lt_dlloader_data_t dlloader_data;
 };
 
-extern lt_dlloader_t *lt_next_dlloader LTDL_PARAMS((lt_dlloader_t *place));
+extern lt_dlloader_t *lt_dlloader_next LTDL_PARAMS((lt_dlloader_t *place));
+extern lt_dlloader_t *lt_dlloader_find LTDL_PARAMS((const char *loader_name));
 extern const char *lt_dlloader_name LTDL_PARAMS((lt_dlloader_t *place));
+extern lt_dlloader_data_t *lt_dlloader_data LTDL_PARAMS((lt_dlloader_t *place));
 extern lt_dlloader_t *lt_find_dlloader LTDL_PARAMS((const char *loader_name));
-extern int lt_add_dlloader LTDL_PARAMS((lt_dlloader_t *place, const struct lt_user_dlloader *dlloader, const char *loader_name));
+extern int lt_dlloader_add LTDL_PARAMS((lt_dlloader_t *place, const struct lt_user_dlloader *dlloader, const char *loader_name));
+extern int lt_dlloader_remove LTDL_PARAMS((const char *loader_name));
 
 /* Integrated lt_dlerror() messages for user loaders. */
 extern int lt_dladderror LTDL_PARAMS((const char *diagnostic));
index e41e28191b9b18092cbabb2c88ddac608e7a78de..cb2351ad3a8648f262dff548ff4046f36d8781f6 100644 (file)
@@ -70,7 +70,7 @@ AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
 AC_REQUIRE([AC_PROG_NM])dnl
 AC_REQUIRE([AC_PROG_LN_S])dnl
 AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
-# Autoconf's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
 AC_REQUIRE([AC_OBJEXT])dnl
 AC_REQUIRE([AC_EXEEXT])dnl
 dnl
index a75fb5523808898734dcb941bc17de9fc1027337..4655e52360cab5497587fac06b9540537fd3aec3 100644 (file)
@@ -66,8 +66,54 @@ cat > conftest.$ac_ext <<EOF
 EOF
 if { ac_try='${CC-c++} -E conftest.$ac_ext'; { (eval echo \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   with_gcc=yes
+
+  # Set up default GNU C++ configuration
+
+  # Check if GNU C++ uses GNU ld as the underlying linker, since the
+  # archiving commands below assume that GNU ld is being used.
+  if eval "`$CC -print-prog-name=ld` --version 2>&1" | \
+      egrep 'GNU ld' > /dev/null; then
+    with_gnu_ld=yes
+
+    archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    archive_expsym_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec='${wl}--export-dynamic'
+
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+    #     investigate it a little bit more. (MM)
+    wlarc='${wl}'
+
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+        egrep 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec=
+    fi
+  else
+    with_gnu_ld=no
+    wlarc=
+
+    # A generic and very simple default shared library creation
+    # command for GNU C++ for the case where it uses the native
+    # linker, instead of GNU ld.  If possible, this setting should
+    # overridden to take advantage of the native linker features on
+    # the platform it is being used on.
+    archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+  fi
+
+  # Commands to make compiler produce verbose output that lists
+  # what "hidden" libraries, object files and flags are used when
+  # linking a shared library.
+  output_verbose_link_cmds='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
+
 else
   with_gcc=no
+  with_gnu_ld=no
+  wlarc=
 fi
 
 # In general, the C++ compiler should always link C++ objects.
@@ -166,9 +212,11 @@ case "$host_os" in
         ;;
       *)
         if test "$with_gcc" = yes; then
-          archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -update_registry ${objdir}/so_locations -o $lib'
-        else
-          archive_cmds='$LD -shared $predep_objects $libobjs $deplibs $postdep_objects $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
+          if test "$with_gnu_ld" = no; then
+            archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -update_registry ${objdir}/so_locations -o $lib'
+          else
+            archive_cmds='$LD -shared $predep_objects $libobjs $deplibs $postdep_objects $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
+          fi
         fi
         hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
         hardcode_libdir_separator=:
@@ -179,14 +227,35 @@ case "$host_os" in
   linux*)
     case "$cc_basename" in
       KCC)
-        # KAI C++ Compiler
-        # FIXME: insert proper C++ library support
-        ld_shlibs=no
+        # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+        # KCC will only create a shared library if the output file
+        # ends with ".so" (or ".sl" for HP-UX), so rename the library
+        # to its proper name (with version) after linking.
+        archive_cmds='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $linker_flags --soname $soname -o \$templib; mv \$templib $lib'
+        archive_expsym_cmds='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $linker_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+
+        # Commands to make compiler produce verbose output that lists
+        # what "hidden" libraries, object files and flags are used when
+        # linking a shared library.
+        #
+        # There doesn't appear to be a way to prevent this compiler from
+        # explicitly linking system object files so we need to strip them
+        # from the output so that they don't get included in the library
+        # dependencies.
+        output_verbose_link_cmds='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest.so 2>&1 | egrep "ld"`; rm -f libconftest.so; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+        hardcode_libdir_flag_spec='${wl}--rpath,$libdir'
+        export_dynamic_flag_spec='${wl}--export-dynamic'
+
+       # Archives containing C++ object files must be created using
+       # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+        old_archive_cmds='$CC -Bstatic -o $oldlib $oldobjs'
         ;;
       cxx)
         # Compaq C++
         archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-soname $wl$soname -o $lib'
-        archive_expsym_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols'
+        archive_expsym_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
 
         runpath_var=LD_RUN_PATH
         hardcode_libdir_flag_spec='-rpath $libdir'
@@ -201,31 +270,6 @@ case "$host_os" in
         # from the output so that they don't get included in the library
         # dependencies.
         output_verbose_link_cmds='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-          ;;
-      *)
-        # GNU C++ compiler
-        if test "$with_gcc" = yes; then
-          archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-          archive_expsym_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
-          runpath_var=LD_RUN_PATH
-          hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
-          export_dynamic_flag_spec='${wl}--export-dynamic'
-
-          # ancient GNU ld didn't support --whole-archive et. al.
-          if eval "$CC -print-prog-name=ld --help 2>&1" | \
-                egrep 'no-whole-archive' > /dev/null; then
-            whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-
-          else
-            whole_archive_flag_spec=
-          fi
-
-          # Commands to make compiler produce verbose output that lists
-          # what "hidden" libraries, object files and flags are used when
-          # linking a shared library.
-          output_verbose_link_cmds='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
-        fi
         ;;
     esac
     ;;
@@ -254,7 +298,7 @@ case "$host_os" in
     ld_shlibs=no
     ;;
   osf3*)
-    if test "$with_gcc" = yes; then
+    if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
       archive_cmds='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
 
@@ -269,9 +313,20 @@ case "$host_os" in
 
     case "$cc_basename" in
       KCC)
-        # KAI C++ Compiler 3.3f
-        # FIXME: insert proper C++ library support
-        ld_shlibs=no
+        # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+        # KCC will only create a shared library if the output file
+        # ends with ".so" (or ".sl" for HP-UX), so rename the library
+        # to its proper name (with version) after linking.
+        archive_cmds='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $linker_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+        hardcode_libdir_separator=:
+
+       # Archives containing C++ object files must be created using
+       # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+        old_archive_cmds='$CC -Bstatic -o $oldlib $oldobjs'
+
         ;;
       RCC)
         # Rational C++ 2.4.1
@@ -281,7 +336,7 @@ case "$host_os" in
       cxx)
         allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
         archive_cmds='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
-        
+
         hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
         hardcode_libdir_separator=:
 
@@ -302,7 +357,7 @@ case "$host_os" in
     esac
     ;;
   osf4* | osf5*)
-    if test "$with_gcc" = yes; then
+    if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
       archive_cmds='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
 
@@ -317,9 +372,19 @@ case "$host_os" in
 
     case "$cc_basename" in
       KCC)
-        # KAI C++ Compiler 3.3f
-        # FIXME: insert proper C++ library support
-        ld_shlibs=no
+        # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+        # KCC will only create a shared library if the output file
+        # ends with ".so" (or ".sl" for HP-UX), so rename the library
+        # to its proper name (with version) after linking.
+        archive_cmds='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $linker_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+        hardcode_libdir_separator=:
+
+       # Archives containing C++ object files must be created using
+       # the KAI C++ compiler.
+        old_archive_cmds='$CC -o $oldlib $oldobjs'
         ;;
       RCC)
         # Rational C++ 2.4.1
@@ -430,8 +495,8 @@ case "$host_os" in
         old_archive_cmds='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
         ;;
       *)
-        # GNU C++ compiler
-        if test "$with_gcc" = yes; then
+        # GNU C++ compiler with Solaris linker
+        if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
           if $CC --version | egrep -v '^2\.7' > /dev/null; then
             archive_cmds='$LD -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linkopts ${wl}-h $wl$soname -o $lib'
             archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
@@ -599,6 +664,7 @@ else
       case "$cc_basename" in
         KCC)
           # KAI C++ Compiler
+          ac_cv_prog_cc_wl='--backend -Wl,'
           ac_cv_prog_cc_pic='-fPIC'
           ;;
         cxx)
@@ -630,7 +696,7 @@ else
     osf3* | osf4* | osf5*)
       case "$cc_basename" in
         KCC)
-          # KAI C++ Compiler 3.3f
+          ac_cv_prog_cc_wl='--backend -Wl,'
           ;;
         RCC)
           # Rational C++ 2.4.1
index 564213622d49cca3f1fe2000853e75eb55fbe0c2..6ee9098801e4b0b5a329cacde12d1f619c31a6f9 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -2152,7 +2152,7 @@ EOF
              esac
              case " $deplibs " in
              *" $path "*) ;;
-             *) deplibs="$deplibs $path" ;;
+             *) deplibs="$path $deplibs" ;;
              esac
            done
          fi