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_
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 {
#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);
}
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) {
}
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;
{
# 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
#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);
}
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) {
}
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;
{
}
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
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. */
}
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) {
}
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;
{
}
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
#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;
}
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) {
}
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;
{
}
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
#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);
}
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) {
}
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;
{
}
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
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)
}
static int
-presym_exit LTDL_PARAMS((void))
+presym_exit (loader_data)
+ lt_dlloader_data_t loader_data;
{
presym_free_symlists();
return 0;
}
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;
}
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 */
}
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;
{
}
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;
lt_dlinit LTDL_PARAMS((void))
{
/* initialize libltdl */
- lt_dlloader_t **loader = &loaders;
int errors = 0;
if (initialized) { /* Initialize only at first call. */
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);
/* 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;
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)
break;
cur = cur->next;
}
+
if (cur) {
cur->info.ref_count++;
*handle = cur;
} 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;
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);
char lsym[LTDL_SYMBOL_LENGTH];
char *sym;
lt_ptr_t address;
+ lt_dlloader_data_t data;
if (!handle) {
last_error = LT_DLSTRERROR(INVALID_HANDLE);
last_error = LT_DLSTRERROR(BUFFER_OVERFLOW);
return 0;
}
+ data = handle->loader->dlloader_data;
if (handle->info.name) {
const char *saved_error = last_error;
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);
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;
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;
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! */
}
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;
/* 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;
}
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;
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;
return place;
}
-\f
static const char **user_error_strings = 0;
static int errorcode = LTDL_ERROR_MAX;
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
#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
};
#undef LTDL_ERROR
-\f
/* An opaque handle for a successfully lt_dlopened module instance. */
#ifdef _LTDL_COMPILE_
typedef struct lt_dlhandle_t *lt_dlhandle;
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. */
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;
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));
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.
;;
*)
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=:
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'
# 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
;;
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'
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
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=:
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'
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
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~
case "$cc_basename" in
KCC)
# KAI C++ Compiler
+ ac_cv_prog_cc_wl='--backend -Wl,'
ac_cv_prog_cc_pic='-fPIC'
;;
cxx)
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