+1999-02-13 Thomas Tanner <tanner@gmx.de>
+
+ * *demo/Makefile.am: use $(MATHLIB)
+ * *demo/configure.in: use AC_CHECK_LIBM
+ * doc/libtool.texi: renamed file_magic_command to file_magic_cmd,
+ renamed archive_sym_cmds to archive_expsym_cmds
+ * ltconfig.in: ditto
+ * ltmain.in: ditto
+ * libltdl/ltdl.c: use lt_dlmalloc/free
+ * libltdl/ltdl.h: define lt_dlmalloc/free
+ * libtool.m4: added AC_CHECK_LIBM macro
+ * ltconfig.in: renamed archive_sym_cmds to archive_expsym_cmds,
+ added always_export_symbols, export_symbols_cmd, exclude_expsyms,
+ include_expsyms, removed archive_cmds for cygwin/mingw and AIX,
+ on Solaris store the exported symbols list in objdir
+ * ltmain.in: allow -export-symbols for modules, use thread_safe flag,
+ add include_expsyms to the exported symbols
+
1999-02-12 Gary V. Vaughan <gvaughan@oranda.demon.co.uk>
* libltdl/ltdl.h (_LTDLL_EXTERN): libltdl is no longer linked as a
bin_PROGRAMS = cdemo
cdemo_SOURCES = main.c
-cdemo_LDADD = libfoo1.la $(LIBADD_M)
+cdemo_LDADD = libfoo1.la $(MATHLIB)
AC_CHECK_HEADERS(math.h)
-AC_CHECK_LIB(m, cos, LIBADD_M="-lm", LIBADD_M=)
-AC_SUBST(LIBADD_M)
+AC_CHECK_LIBM
dnl Output the makefile
AC_OUTPUT(Makefile)
# Build a libtool library, libhello.la for installation in libdir.
lib_LTLIBRARIES = libhello.la
libhello_la_SOURCES = hello.c foo.c
-libhello_la_LDFLAGS = -version-info 3:12:1 $(LIBADD_M)
+libhello_la_LDFLAGS = -version-info 3:12:1 $(MATHLIB)
include_HEADERS = foo.h
AC_CHECK_HEADERS(string.h math.h)
-AC_CHECK_LIB(m, cos, LIBADD_M="-lm", LIBADD_M=)
-AC_SUBST(LIBADD_M)
+AC_CHECK_LIBM
dnl Output the makefile
AC_OUTPUT(Makefile)
libl3_la_SOURCES = l3.c l3.h sysdep.h
libl3_la_LIBADD = libl1.la libl2.la
libl4_la_SOURCES = l4.c l4.h sysdep.h
-libl4_la_LIBADD = libl3.la $(LIBADD_M)
+libl4_la_LIBADD = libl3.la $(MATHLIB)
bin_PROGRAMS = depdemo depdemo.static
AC_CHECK_HEADERS(math.h)
-AC_CHECK_LIB(m, cos, LIBADD_M="-lm", LIBADD_M=)
-AC_SUBST(LIBADD_M)
+AC_CHECK_LIBM
dnl Output the makefile
AC_OUTPUT(Makefile)
The basic architecture is this: in @file{ltconfig.in}, the person who
writes libtool makes sure @samp{$deplibs}, or @samp{$compile_dependencylibs}
are included in @samp{$archive_cmds} somewhere and also sets the
-@samp{$deplibs_check_method}, and maybe @samp{$file_magic_command} when
+@samp{$deplibs_check_method}, and maybe @samp{$file_magic_cmd} when
@samp{deplibs_check_method} is file_magic.
@samp{deplibs_check_method} can be one of five things:
@table @samp
@item file_magic [@var{regex}]
@vindex file_magic
-@vindex file_magic_command
+@vindex file_magic_cmd
looks in the library link path for libraries that have the right
-libname. Then it runs @samp{$file_magic_command} on the library and
+libname. Then it runs @samp{$file_magic_cmd} on the library and
checks for a match against @samp{regex} using @code{egrep}.
@item test_compile
@end defvar
@defvar archive_cmds
-@defvarx archive_sym_cmds
+@defvarx archive_expsym_cmds
@defvarx old_archive_cmds
Commands used to create shared and static libraries, respectively.
-@samp{archive_sym_cmds} is used when -export-symbols was defined.
+@samp{archive_expsym_cmds} is used when -export-symbols was defined.
@end defvar
@defvar old_archive_from_new_cmds
static const char *last_error = 0;
+lt_ptr_t (*lt_dlmalloc)(size_t size) = malloc;
+void (*lt_dlfree)(lt_ptr_t ptr) = free;
+
typedef struct lt_dltype_t {
struct lt_dltype_t *next;
const char *sym_prefix; /* prefix for symbols */
if (!str)
return str;
- tmp = (char*) malloc(strlen(str)+1);
+ tmp = (char*) lt_dlmalloc(strlen(str)+1);
if (tmp)
strcpy(tmp, str);
return tmp;
}
if (dld_link(filename) != 0) {
last_error = unknown_error;
- free(handle->handle);
+ lt_dlfree(handle->handle);
return 1;
}
return 0;
last_error = unknown_error;
return 1;
}
- free(handle->filename);
+ lt_dlfree(handle->filename);
return 0;
}
lt_dlsymlists_t *tmp = lists;
lists = lists->next;
- free(tmp);
+ lt_dlfree(tmp);
}
preloaded_symbols = 0;
return 0;
lists = lists->next;
}
- tmp = (lt_dlsymlists_t*) malloc(sizeof(lt_dlsymlists_t));
+ tmp = (lt_dlsymlists_t*) lt_dlmalloc(sizeof(lt_dlsymlists_t));
if (!tmp) {
last_error = memory_error;
return 1;
}
if (!type) {
if (cur->filename)
- free(cur->filename);
+ lt_dlfree(cur->filename);
return 1;
}
cur->type = type;
if (installed && libdir) {
int ret;
char *filename = (char*)
- malloc(strlen(libdir)+1+strlen(dlname)+1);
+ lt_dlmalloc(strlen(libdir)+1+strlen(dlname)+1);
if (!filename) {
last_error = memory_error;
strcat(filename, "/");
strcat(filename, dlname);
ret = tryall_dlopen(handle, filename) == 0;
- free(filename);
+ lt_dlfree(filename);
if (ret)
return 0;
}
if (!installed) {
int ret;
char *filename = (char*)
- malloc((dir ? strlen(dir) : 0)
+ lt_dlmalloc((dir ? strlen(dir) : 0)
+ strlen(objdir) + strlen(dlname) + 1);
if (!filename) {
strcat(filename, dlname);
ret = tryall_dlopen(handle, filename) == 0;
- free(filename);
+ lt_dlfree(filename);
if (ret)
return 0;
}
{
int ret;
char *filename = (char*)
- malloc((dir ? strlen(dir) : 0)
+ lt_dlmalloc((dir ? strlen(dir) : 0)
+ strlen(dlname) + 1);
if (dir)
strcpy(filename, dir);
*filename = 0;
strcat(filename, dlname);
ret = tryall_dlopen(handle, filename) == 0;
- free(filename);
+ lt_dlfree(filename);
if (ret)
return 0;
}
continue;
if (lendir + 1 + lenbase >= filenamesize) {
if (filename)
- free(filename);
+ lt_dlfree(filename);
filenamesize = lendir + 1 + lenbase + 1;
- filename = (char*) malloc(filenamesize);
+ filename = (char*) lt_dlmalloc(filenamesize);
if (!filename) {
last_error = memory_error;
return 0;
strcpy(filename+lendir, basename);
if (handle) {
if (tryall_dlopen(handle, filename) == 0) {
- free(filename);
+ lt_dlfree(filename);
return (lt_ptr_t) handle;
}
} else {
FILE *file = fopen(filename, LTDL_READTEXT_MODE);
if (file) {
if (*pdir)
- free(*pdir);
+ lt_dlfree(*pdir);
filename[lendir] = '\0';
*pdir = strdup(filename);
if (!*pdir) {
memory overhead. */
*pdir = filename;
} else
- free(filename);
+ lt_dlfree(filename);
return (lt_ptr_t) file;
}
}
}
if (filename)
- free(filename);
+ lt_dlfree(filename);
last_error = file_not_found_error;
return 0;
}
int len = strlen(s);
if (*dest)
- free(*dest);
+ lt_dlfree(*dest);
if (len > 3 && s[0] == '\'') {
- tmp = (char*) malloc(i - s);
+ tmp = (char*) lt_dlmalloc(i - s);
if (!tmp) {
last_error = memory_error;
return 1;
char *deplibs;
{
if (dir)
- free(dir);
+ lt_dlfree(dir);
if (name)
- free(name);
+ lt_dlfree(name);
if (dlname)
- free(dlname);
+ lt_dlfree(dlname);
if (oldname)
- free(oldname);
+ lt_dlfree(oldname);
if (libdir)
- free(libdir);
+ lt_dlfree(libdir);
if (deplibs)
- free(deplibs);
+ lt_dlfree(deplibs);
return 0;
}
char *dir = 0, *name = 0;
if (!filename) {
- handle = (lt_dlhandle) malloc(sizeof(lt_dlhandle_t));
+ handle = (lt_dlhandle) lt_dlmalloc(sizeof(lt_dlhandle_t));
if (!handle) {
last_error = memory_error;
return 0;
handle->usage = 0;
newhandle = handle;
if (tryall_dlopen(handle, 0) != 0) {
- free(newhandle);
+ lt_dlfree(newhandle);
return 0;
}
if (newhandle != handle)
- free(newhandle);
+ lt_dlfree(newhandle);
return handle;
}
basename = strrchr(filename, '/');
if (basename) {
basename++;
- dir = (char*) malloc(basename - filename + 1);
+ dir = (char*) lt_dlmalloc(basename - filename + 1);
if (!dir) {
last_error = memory_error;
return 0;
int installed = 1;
/* extract the module name from the file name */
- name = (char*) malloc(ext - basename + 1);
+ name = (char*) lt_dlmalloc(ext - basename + 1);
if (!name) {
last_error = memory_error;
if (dir)
- free(dir);
+ lt_dlfree(dir);
return 0;
}
/* canonicalize the module name */
}
if (!file) {
if (name)
- free(name);
+ lt_dlfree(name);
if (dir)
- free(dir);
+ lt_dlfree(dir);
return 0;
}
/* read the .la file */
}
fclose(file);
/* allocate the handle */
- handle = (lt_dlhandle) malloc(sizeof(lt_dlhandle_t));
+ handle = (lt_dlhandle) lt_dlmalloc(sizeof(lt_dlhandle_t));
if (!handle || error) {
if (handle)
- free(handle);
+ lt_dlfree(handle);
if (!error)
last_error = memory_error;
free_vars(name, dir, dlname, old_name, libdir, deplibs);
} else
error = 1;
if (error) {
- free(handle);
+ lt_dlfree(handle);
free_vars(name, dir, dlname, old_name, libdir, deplibs);
return 0;
}
}
} else {
/* not a libtool module */
- handle = (lt_dlhandle) malloc(sizeof(lt_dlhandle_t));
+ handle = (lt_dlhandle) lt_dlmalloc(sizeof(lt_dlhandle_t));
if (!handle) {
last_error = memory_error;
if (dir)
- free(dir);
+ lt_dlfree(dir);
return 0;
}
handle->usage = 0;
0, &handle)
#endif
))) {
- free(handle);
+ lt_dlfree(handle);
if (dir)
- free(dir);
+ lt_dlfree(dir);
return 0;
}
}
if (newhandle != handle) {
- free(handle);
+ lt_dlfree(handle);
handle = newhandle;
}
if (!handle->usage) {
handle->next = handles;
handles = handle;
} else if (name)
- free(name);
+ lt_dlfree(name);
if (dir)
- free(dir);
+ lt_dlfree(dir);
last_error = saved_error;
return handle;
}
if (handle)
return handle;
/* try "filename.la" */
- tmp = (char*) malloc(len+4);
+ tmp = (char*) lt_dlmalloc(len+4);
if (!tmp) {
last_error = memory_error;
return 0;
handle = lt_dlopen(tmp);
if (handle) {
last_error = saved_error;
- free(tmp);
+ lt_dlfree(tmp);
return handle;
}
#ifdef LTDL_SHLIB_EXT
/* try "filename.EXT" */
if (strlen(shlib_ext) > 3) {
- free(tmp);
- tmp = (char*) malloc(len + strlen(shlib_ext) + 1);
+ lt_dlfree(tmp);
+ tmp = (char*) lt_dlmalloc(len + strlen(shlib_ext) + 1);
if (!tmp) {
last_error = memory_error;
return 0;
handle = lt_dlopen(tmp);
if (handle) {
last_error = saved_error;
- free(tmp);
+ lt_dlfree(tmp);
return handle;
}
#endif
last_error = file_not_found_error;
- free(tmp);
+ lt_dlfree(tmp);
return 0;
}
handles = handle->next;
error = handle->type->lib_close(handle);
error += unload_deplibs(handle);
- free(handle->filename);
+ lt_dlfree(handle->filename);
if (handle->name)
- free(handle->name);
- free(handle);
+ lt_dlfree(handle->name);
+ lt_dlfree(handle);
return error;
}
return 0;
if (lensym + LTDL_SYMBOL_OVERHEAD < LTDL_SYMBOL_LENGTH)
sym = lsym;
else
- sym = (char*) malloc(lensym + LTDL_SYMBOL_OVERHEAD + 1);
+ sym = (char*) lt_dlmalloc(lensym + LTDL_SYMBOL_OVERHEAD + 1);
if (!sym) {
last_error = buffer_overflow_error;
return 0;
address = handle->type->find_sym(handle, sym);
if (address) {
if (sym != lsym)
- free(sym);
+ lt_dlfree(sym);
return address;
}
}
strcpy(sym, symbol);
address = handle->type->find_sym(handle, sym);
if (sym != lsym)
- free(sym);
+ lt_dlfree(sym);
return address;
}
}
} else {
char *new_search_path = (char*)
- malloc(strlen(user_search_path) +
+ lt_dlmalloc(strlen(user_search_path) +
strlen(search_dir) + 1);
if (!new_search_path) {
last_error = memory_error;
}
strcat(new_search_path, ":");
strcat(new_search_path, search_dir);
- free(user_search_path);
+ lt_dlfree(user_search_path);
user_search_path = new_search_path;
}
return 0;
const char *search_path;
{
if (user_search_path)
- free(user_search_path);
+ lt_dlfree(user_search_path);
user_search_path = 0; /* reset the search path */
if (!search_path || !strlen(search_path))
return 0;
# define lt_ptr_t char*
#endif
+#include <stdlib.h>
+
#ifdef _LTDL_COMPILE_
typedef struct lt_dlhandle_t *lt_dlhandle;
#else
extern const lt_dlsymlist lt_preloaded_symbols[];
#define LTDL_SET_PRELOADED_SYMBOLS() lt_dlpreload_default(lt_preloaded_symbols)
+extern lt_ptr_t (*lt_dlmalloc)(size_t size);
+extern void (*lt_dlfree)(lt_ptr_t ptr);
+
__END_DECLS
#endif /* !_LTDL_H_ */
AC_SUBST(USE_SYMBOL_UNDERSCORE)dnl
])
+# AC_CHECK_LIBM - check for math library
+AC_DEFUN(AC_CHECK_LIBM,
+[
+AC_CHECK_LIB(mw, _mwvalidcheckl, MATHLIB="-lmw", MATHLIB=)
+AC_CHECK_LIB(m, cos, MATHLIB="-lm $MATHLIB", )
+AC_SUBST(MATHLIB)dnl
+])
+
dnl old names
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
# when you set need_version to no, make sure it does not cause -set_version
# flags to be left without arguments
archive_cmds=
-archive_sym_cmds=
+archive_expsym_cmds=
old_archive_from_new_cmds=
export_dynamic_flag_spec=
whole_archive_flag_spec=
hardcode_minus_L=no
hardcode_shlibpath_var=unsupported
runpath_var=
+always_export_symbols=no
+export_symbols_cmd="$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq > $export_symbols"
+include_expsyms=
+exclude_expsyms=
case "$host_os" in
aix3* | aix4*)
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ export_symbols_cmd='$DLLTOOL --export-all --output-def $export_symbols $objdir/$soname-ltdll.$objext $libobjs'
- archive_cmds='rm -f $objdir/$soname-ltdll.c~
- sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
- (cd $objdir && $CC -c $soname-ltdll.c)~
- echo EXPORTS > $objdir/$soname-def~
- $DLLTOOL --export-all --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs~
- $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
- $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
- $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
- $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
- $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
-
- archive_sym_cmds='rm -f $objdir/$soname-ltdll.c~
+ archive_expsym_cmds='rm -f $objdir/$soname-ltdll.c~
sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
(cd $objdir && $CC -c $soname-ltdll.c)~
echo EXPORTS > $objdir/$soname-def~
*)
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib $libobjs $deplibs $linkopts'
- archive_sym_cmds='$CC -shared ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib $libobjs $deplibs $linkopts'
+ archive_expsym_cmds='$CC -shared ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib $libobjs $deplibs $linkopts'
else
ld_shlibs=no
fi
case "$host_os" in
aix3*)
allow_undefined_flag=unsupported
- archive_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp~
- $LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$lib.exp -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
- archive_sym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
fi
archive_cmds='$CC -shared ${wl}-bnoentry -o $objdir/$soname $libobjs $deplibs $linkopts'
else
- archive_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp~
- $CC -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry'
- archive_sym_cmds='$CC -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bM:SRE ${wl}-bnoentry'
+ always_export_symbols=yes
+ archive_expsym_cmds='$CC -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bM:SRE ${wl}-bnoentry'
hardcode_direct=yes
fi
hardcode_minus_L=yes
# $CC -shared without GNU ld will not create a library from C++
# object files and a static libstdc++, better avoid it by now
archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
- archive_sym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
+ archive_expsym_cmds='$echo "{ global:" > $objdir/$lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $objdir/$lib.exp~$echo "local: *; };" >> $objdir/$lib.exp~
+ $LD -G${allow_undefined_flag} -M $objdir/$lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $objdir/$lib.exp'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_shlibpath_var=no
;;
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-file_magic_command=
+file_magic_cmd=
deplibs_check_method='unknown'
# Need to set the preceding variable on all platforms that support
# interlibrary dependencies.
# 'pass_all' -- all dependencies passed with no checks.
# 'test_compile' -- check by making test program.
# 'file_magic [regex]' -- check by looking for files in library path
-# which responds to the $file_magic_command with a given egrep regex.
+# which responds to the $file_magic_cmd with a given egrep regex.
# If you have `file' or equivalent on your system and you're not sure
# whether `pass_all' will *always* work, you probably want this one.
echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
fi
dynamic_linker='Win32 ld.exe'
deplibs_check_method='file_magic file format pei*-i386.*architecture: i386'
- file_magic_command='objdump -f'
+ file_magic_cmd='objdump -f'
need_lib_prefix=no
# FIXME: first we should search . and the directory the executable is in
shlibpath_var=PATH
case "$version_type" in
freebsd-elf*)
deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
- file_magic_command=file
+ file_magic_cmd=file
;;
freebsd-*)
deplibs_check_method=unknown
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
shlibpath_var=LD_LIBRARY_PATH
deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" # or should it be pass_all?
- file_magic_command=file
+ file_magic_cmd=file
;;
irix6*)
shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" # or should it be pass_all?
- file_magic_command=file
+ file_magic_cmd=file
;;
# No shared lib support for Linux oldld, aout, or coff.
finish_cmds='PATH="$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
- file_magic_command=file
+ file_magic_cmd=file
if test -f /lib/ld.so.1; then
dynamic_linker='GNU ld.so'
# ldd complains unless libraries are executable
postinstall_cmds='chmod +x $lib'
deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib"
- file_magic_command="file"
+ file_magic_cmd="file"
;;
sunos4*)
thread_safe_flag_spec whole_archive_flag_spec libname_spec \
library_names_spec soname_spec \
RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
- old_postuninstall_cmds archive_cmds archive_sym_cmds postinstall_cmds postuninstall_cmds \
- file_magic_command deplibs_check_method allow_undefined_flag no_undefined_flag \
+ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \
+ file_magic_cmd export_symbols_cmd deplibs_check_method allow_undefined_flag no_undefined_flag \
finish_cmds finish_eval global_symbol_pipe hardcode_libdir_flag_spec \
hardcode_libdir_separator sys_lib_search_path_spec \
- compiler_c_o compiler_o_lo need_locks; do
+ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
case "$var" in
reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
old_postinstall_cmds | old_postuninstall_cmds | \
- archive_cmds | archive_sym_cmds | \
+ archive_cmds | archive_expsym_cmds | \
postinstall_cmds | postuninstall_cmds | \
finish_cmds | sys_lib_search_path_spec)
# Double-quote double-evaled strings.
# Commands used to build and install a shared archive.
archive_cmds=$archive_cmds
-archive_sym_cmds=$archive_sym_cmds
+archive_expsym_cmds=$archive_expsym_cmds
postinstall_cmds=$postinstall_cmds
postuninstall_cmds=$postuninstall_cmds
deplibs_check_method=$deplibs_check_method
# Command to use when deplibs_check_method == file_magic
-file_magic_command=$file_magic_command
+file_magic_cmd=$file_magic_cmd
# Flag that allows shared libraries with undefined symbols to be built.
allow_undefined_flag=$allow_undefined_flag
# Fix the shell variable \$srcfile for the compiler.
fix_srcfile_path="$fix_srcfile_path"
+
+# Set to yes if exported symbols are required
+always_export_symbols=$always_export_symbols
+
+# The command to extract exported symbols
+export_symbols_cmd=$export_symbols_cmd
+
+# Symbols that should not be listed in the preloaded symbols
+exclude_expsyms=$exclude_expsyms
+
+# Symbols that must always be exported
+include_expsyms=$include_expsyms
+
EOF
case "$ltmain" in
exit 1
fi
- if test -n "$export_symbols" && test "$module" = yes; then
- $echo "$modename: \`-export-symbols' is not supported for modules"
- exit 1
- fi
-
oldlibs=
# calculate the name of the file, without its directory
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
| $Xsed -e 's,[^/]*$,,'`"$potliblink";;
esac
done
- if eval $file_magic_command \"\$potlib\" \
+ if eval $file_magic_cmd \"\$potlib\" \
| sed '11,$d' \
| egrep "$file_magic_regex" > /dev/null; then
newdeplibs="$newdeplibs $a_deplib"
done
fi
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+
+ linkopts="$linkopts $flag"
+ fi
+
+ # Prepare the list of exported symbols
+ if test "$always_export_symbols" = yes && test -z "$export_symbols"; then
+ export_symbols="$objdir/$libname.exp"
+ $run $rm $export_symbols
+ $run eval "$export_symbols_cmd"
+ fi
+ if test -n "$include_expsyms"; then
+ $run $echo "X$include_expsyms" | $SP2NL >> $export_symbols
+ fi
+
# Do each of the archive commands.
- if test -n "$export_symbols" && test -n "$archive_sym_cmds"; then
- eval cmds=\"$archive_sym_cmds\"
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval cmds=\"$archive_expsym_cmds\"
else
eval cmds=\"$archive_cmds\"
fi
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
done
+ if test -n "$exclude_expsyms"; then
+ : # TODO: remove symbols from $nlist
+ fi
+
if test -z "$run"; then
# Make sure we have at least an empty file.
test -f "$nlist" || : > "$nlist"
for arg in $progfiles; do
eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
done
+ if test -n "$exclude_expsyms"; then
+ : # TODO: remove symbols from $nlist
+ fi
if test -f "$nlist"; then
sed 's/^\(.*\) \(.*\)$/ {"\1", (lt_ptr_t) \&\2},/' < "$nlist" >> "$output_objdir/$dlsyms"
else
{\"$name\", (lt_ptr_t) 0},"
eval "$NM $arg | $global_symbol_pipe > '$nlist'"
+ if test -n "$exclude_expsyms"; then
+ : # TODO: remove symbols from $nlist
+ fi
if test -f "$nlist"; then
sed 's/^\(.*\) \(.*\)$/ {"\1", (lt_ptr_t) \&\2},/' < "$nlist" >> "$output_objdir/$dlsyms"
else
lib_LTLIBRARIES = foo1.la libfoo2.la
foo1_la_SOURCES = foo1.c
-foo1_la_LDFLAGS = $(LIBADD_M) -module -avoid-version
+foo1_la_LDFLAGS = $(MATHLIB) -module -avoid-version
libfoo2_la_SOURCES = foo2.c
-libfoo2_la_LDFLAGS = $(LIBADD_M) -module
+libfoo2_la_LDFLAGS = $(MATHLIB) -module
noinst_HEADERS = foo.h
AC_CHECK_HEADERS(math.h)
-AC_CHECK_LIB(m, cos, LIBADD_M="-lm", LIBADD_M=)
-AC_SUBST(LIBADD_M)
+AC_CHECK_LIBM
dnl Output the makefile
AC_OUTPUT(Makefile)