From e65f46d3fc4eb98d25ee94ad8e6f51c5846c8fe3 Mon Sep 17 00:00:00 2001 From: Thomas Tanner Date: Sat, 20 Mar 1999 00:27:33 +0000 Subject: [PATCH] * use the same header in all configure.in's and Makefile.am's * NEWS: improved support for BeOS and Cygwin * TODO: ILD branch was merged, all internal variables and macros are now documented * demo/Makefile.am: use $(LIBS) instead of -lm * doc/libtool.texi: documented new variable hardcode_into_libs and thread_safe_flag_spec, renamed all AM_ENABLE/DISABLE_* macros to AC_*, documented AC_DISABLE_FAST_INSTALL and AC_LIBTOOL_DLOPEN * libltdl/ltdl.c: added two new error messages (cannot_open_error, cannot_close_error), use them where approriate, BeOS support (thanks to Xavier Pianet), on BeOS search modules additionally in ADDON_PATH * libtool.m4: rewrote AC_CHECK_LIBM: BeOS and Cygwin don't have libm and *-ncr-sysv4.3* requires libmw * ltconfig.in: don't check for LoadLibrary, hardcode dlopen configuration for BeOS and Cygwin * ltmain.in: fix sourcing of .la files on Solaris (patch by Raja R Harinath) --- ChangeLog | 21 ++++++++ Makefile.am | 3 +- NEWS | 3 +- TODO | 14 +---- cdemo/Makefile.am | 4 +- cdemo/configure.in | 3 +- demo/Makefile.am | 20 +++---- demo/configure.in | 3 +- depdemo/Makefile.am | 4 +- depdemo/configure.in | 3 +- depdemo/l1/Makefile.am | 3 +- depdemo/l2/Makefile.am | 3 +- depdemo/l3/Makefile.am | 3 +- depdemo/l4/Makefile.am | 3 +- doc/Makefile.am | 9 +--- doc/libtool.texi | 40 +++++++++++--- libltdl/Makefile.am | 4 +- libltdl/configure.in | 2 +- libltdl/ltdl.c | 120 ++++++++++++++++++++++++++++++++++++----- libtool.m4 | 17 ++++-- ltconfig.in | 53 ++---------------- ltmain.in | 20 +++++-- mdemo/Makefile.am | 4 +- mdemo/configure.in | 3 +- tests/Makefile.am | 2 +- 25 files changed, 235 insertions(+), 129 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2db68ee5..021ee495 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +1999-03-19 Thomas Tanner + + * use the same header in all configure.in's and Makefile.am's + * NEWS: improved support for BeOS and Cygwin + * TODO: ILD branch was merged, all internal variables and macros + are now documented + * demo/Makefile.am: use $(LIBS) instead of -lm + * doc/libtool.texi: documented new variable hardcode_into_libs + and thread_safe_flag_spec, renamed all AM_ENABLE/DISABLE_* macros + to AC_*, documented AC_DISABLE_FAST_INSTALL and AC_LIBTOOL_DLOPEN + * libltdl/ltdl.c: added two new error messages (cannot_open_error, + cannot_close_error), use them where approriate, + BeOS support (thanks to Xavier Pianet), on BeOS search modules + additionally in ADDON_PATH + * libtool.m4: rewrote AC_CHECK_LIBM: BeOS and Cygwin don't have + libm and *-ncr-sysv4.3* requires libmw + * ltconfig.in: don't check for LoadLibrary, hardcode dlopen + configuration for BeOS and Cygwin + * ltmain.in: fix sourcing of .la files on Solaris + (patch by Raja R Harinath) + 1999-03-19 Alexandre Oliva * ltconfig.in (sunos4*, with_gnu_ld, hardcode_minus_L): remove, we diff --git a/Makefile.am b/Makefile.am index 14005eea..a43a37cf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,4 @@ -## Process Makefile.am with automake to create Makefile.in. -*-Makefile-*- -## Gordon Matzigkeit , 1996 +## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = 1.3e gnits readme-alpha diff --git a/NEWS b/NEWS index 51c0e8d4..674c25f2 100644 --- a/NEWS +++ b/NEWS @@ -9,7 +9,8 @@ New in 1.3a: CVS version, Libtool team: * Various bugfixes New in 1.2g: CVS version, Libtool team: -* Nothing so far +* dlopen support for BeOS +* Improved support for BeOS and Cygwin New in 1.2e: CVS version; 1.2f: 1999-03-15, Libtool team: * libtool will correctly link uninstalled libraries into programs diff --git a/TODO b/TODO index 26e82545..e55a4a9d 100644 --- a/TODO +++ b/TODO @@ -4,11 +4,6 @@ For next public release: * check whether the version of libtool.m4 is compatible with ltconfig/ltmain.sh -* Inter-library dependencies should be fully tracked by libtool -and need to work for ltlibraries too. This requires looking up -installed libtool libraries for transparent support. -Thomas Tanner has a patch for this. - * Alexandre Oliva suggests that we should have an option to hardcode paths into libraries, as well as binaries: `... -Wl,-soname -Wl,/tmp/libtest.so.0 ...'. Tim Mooney wants the same thing. @@ -16,14 +11,7 @@ paths into libraries, as well as binaries: `... -Wl,-soname * Lists of exported symbols should be stored in the pseudo library so that the size of lt_preloaded_symbols can be reduced. -* Documentation: - -- AC_PROG_LIBTOOL, AC_ENABLE/DISABLE_SHARED/STATIC/FAST_INSTALL, - AC_LIBTOOL_DLOPEN, AC_LIBLTDL_CONVENIENCE/INSTALLABLE are not documented - -- Purpose and usage of convenience libraries must be better documented - -- some new internal variables are not documented yet. +* Purpose and usage of convenience libraries must be better documented In the future: ************** diff --git a/cdemo/Makefile.am b/cdemo/Makefile.am index 4fe09947..ab054957 100644 --- a/cdemo/Makefile.am +++ b/cdemo/Makefile.am @@ -1,5 +1,5 @@ -# A brief demonstration of Libtool modules. -*-Makefile-*- -# +## Process this file with automake to produce Makefile.in + AUTOMAKE_OPTIONS = no-dependencies foreign EXTRA_DIST = acinclude.m4 diff --git a/cdemo/configure.in b/cdemo/configure.in index cf28fa65..eea60fb9 100644 --- a/cdemo/configure.in +++ b/cdemo/configure.in @@ -1,4 +1,5 @@ -dnl Initialize the cdemo package. +dnl Process this file with autoconf to create configure. + AC_INIT(main.c) AM_INIT_AUTOMAKE(cdemo,0.1) diff --git a/demo/Makefile.am b/demo/Makefile.am index 1df6fec2..87b7ef3f 100644 --- a/demo/Makefile.am +++ b/demo/Makefile.am @@ -1,5 +1,5 @@ -# A brief demonstration of using Automake with Libtool. -*-Makefile-*- -# +## Process this file with automake to produce Makefile.in + AUTOMAKE_OPTIONS = no-dependencies foreign EXTRA_DIST = $(TESTS) acinclude.m4 @@ -76,8 +76,8 @@ hc-direct: $(hell_OBJECTS) $(hell_DEPENDENCIES) $(libdir)/libhello.la eval `egrep -e '^(hardcode_.*|wl)=' libtool`; \ libdir=$(libdir); \ flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \ - echo "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib -lm $$flag || echo unsupported > $@"; \ - eval "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib -lm $$flag || echo unsupported > $@" + echo "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib $(LIBS) $$flag || echo unsupported > $@"; \ + eval "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib $(LIBS) $$flag || echo unsupported > $@" hc-libflag: $(hell_OBJECTS) $(hell_DEPENDENCIES) $(libdir)/libhello.la @eval `egrep -e '^(hardcode_.*|wl)=' libtool`; \ @@ -87,8 +87,8 @@ hc-libflag: $(hell_OBJECTS) $(hell_DEPENDENCIES) $(libdir)/libhello.la echo "echo unsupported > $@"; \ echo unsupported > $@ || status="$$?"; \ else \ - echo "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$flag -L$(libdir) -lhello -lm"; \ - $(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$flag -L$(libdir) -lhello -lm || status="$$?"; \ + echo "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$flag -L$(libdir) -lhello $(LIBS)"; \ + $(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$flag -L$(libdir) -lhello $(LIBS) || status="$$?"; \ fi; \ exit $$status @@ -98,16 +98,16 @@ hc-libpath: $(hell_OBJECTS) $(hell_DEPENDENCIES) $(libdir)/libhello.la @eval `egrep -e '^(shlibpath_var|hardcode_.*|wl)=' libtool`; \ libdir=$(libdir); \ flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \ - echo "$$shlibpath_var=./$(objdir) $(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -lhello -lm $$flag || echo unsupported > $@"; \ - eval "$$shlibpath_var=./$(objdir) $(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -lhello -lm $$flag || echo unsupported > $@" + echo "$$shlibpath_var=./$(objdir) $(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -lhello $(LIBS) $$flag || echo unsupported > $@"; \ + eval "$$shlibpath_var=./$(objdir) $(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -lhello $(LIBS) $$flag || echo unsupported > $@" hc-minusL: $(hell_OBJECTS) $(hell_DEPENDENCIES) @rm -f hc-minusL @eval `egrep -e '^(hardcode_.*|wl)=' libtool`; \ libdir=$(libdir); \ flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \ - echo "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello -lm $$flag || echo unsupported > $@"; \ - eval "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello -lm $$flag || echo unsupported > $@" + echo "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello $(LIBS) $$flag || echo unsupported > $@"; \ + eval "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello $(LIBS) $$flag || echo unsupported > $@" $(OBJECTS): libtool libtool: $(LIBTOOL_DEPS) diff --git a/demo/configure.in b/demo/configure.in index 2641d861..c419b56b 100644 --- a/demo/configure.in +++ b/demo/configure.in @@ -1,4 +1,5 @@ -dnl Initialize the hell package. +dnl Process this file with autoconf to create configure. + AC_INIT(hello.c) AM_INIT_AUTOMAKE(hell,1.0) diff --git a/depdemo/Makefile.am b/depdemo/Makefile.am index c3d3aa3d..64dd5871 100644 --- a/depdemo/Makefile.am +++ b/depdemo/Makefile.am @@ -1,5 +1,5 @@ -# A brief demonstration of inter-library dependencies -# +## Process this file with automake to produce Makefile.in + AUTOMAKE_OPTIONS = no-dependencies foreign SUBDIRS = l1 l2 l3 l4 diff --git a/depdemo/configure.in b/depdemo/configure.in index bfd04c2b..e4e317e7 100644 --- a/depdemo/configure.in +++ b/depdemo/configure.in @@ -1,4 +1,5 @@ -dnl Initialize the depdemo package. +dnl Process this file with autoconf to create configure. + AC_INIT(main.c) AM_INIT_AUTOMAKE(depdemo,0.1) diff --git a/depdemo/l1/Makefile.am b/depdemo/l1/Makefile.am index c5a22ed4..9ab4f6a0 100644 --- a/depdemo/l1/Makefile.am +++ b/depdemo/l1/Makefile.am @@ -1,5 +1,4 @@ -# A brief demonstration of inter-library dependencies -# +## Process this file with automake to produce Makefile.in INCLUDES = -I$(top_srcdir) diff --git a/depdemo/l2/Makefile.am b/depdemo/l2/Makefile.am index 6509f3b0..2b8d44a6 100644 --- a/depdemo/l2/Makefile.am +++ b/depdemo/l2/Makefile.am @@ -1,5 +1,4 @@ -# A brief demonstration of inter-library dependencies -# +## Process this file with automake to produce Makefile.in INCLUDES = -I$(top_srcdir) diff --git a/depdemo/l3/Makefile.am b/depdemo/l3/Makefile.am index ed28ea14..8dbca820 100644 --- a/depdemo/l3/Makefile.am +++ b/depdemo/l3/Makefile.am @@ -1,5 +1,4 @@ -# A brief demonstration of inter-library dependencies -# +## Process this file with automake to produce Makefile.in INCLUDES = -I$(top_srcdir) diff --git a/depdemo/l4/Makefile.am b/depdemo/l4/Makefile.am index 1bfea223..45c6b675 100644 --- a/depdemo/l4/Makefile.am +++ b/depdemo/l4/Makefile.am @@ -1,5 +1,4 @@ -# A brief demonstration of inter-library dependencies -# +## Process this file with automake to produce Makefile.in INCLUDES = -I$(top_srcdir) diff --git a/doc/Makefile.am b/doc/Makefile.am index 9df4e7f8..b07461d5 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,10 +1,5 @@ -## Process Makefile.am with automake to create Makefile.in. -*-Makefile-*- -## -## Copyright (C) 1996 Free Software Foundation, Inc. -## This Makefile.am is free software; the Free Software Foundation -## gives unlimited permission to copy, distribute and modify it. -## -## Written by Gordon Matzigkeit +## Process this file with automake to produce Makefile.in + AUTOMAKE_OPTIONS = gnits info_TEXINFOS = libtool.texi libtool_TEXINFOS = PLATFORMS diff --git a/doc/libtool.texi b/doc/libtool.texi index 12dc09d3..0ec3961d 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -1619,12 +1619,12 @@ example).} By default, this macro turns on shared libraries if they are available, and also enables static libraries if they don't conflict with the shared libraries. You can modify these defaults by calling either the -@code{AM_DISABLE_SHARED} or @code{AM_DISABLE_STATIC} macros: +@code{AC_DISABLE_SHARED} or @code{AC_DISABLE_STATIC} macros: @example # Turn off shared libraries during beta-testing, since they # make the build process take too long. -AM_DISABLE_SHARED +AC_DISABLE_SHARED AM_PROG_LIBTOOL @end example @@ -1644,7 +1644,9 @@ configuring with @samp{--enable-shared} every package named in the comma-separated @var{pkgs} list, and every other package with @samp{--disable-shared}. The @samp{--enable-static=@var{pkgs}} flag behaves similarly, but it uses @samp{--enable-static} and -@samp{--disable-static}. +@samp{--disable-static}. The same applies to the +@samp{--enable-fast-install=@var{pkgs}} flag, which uses +@samp{--enable-fast-install} and @samp{--disable-fast-install}. The package name @samp{default} matches any packages which have not set their name in the @code{PACKAGE} environment variable. @@ -1672,13 +1674,28 @@ on @file{libtool}. @end defmac -@defmac AM_DISABLE_SHARED +@defmac AC_LIBTOOL_DLOPEN +Enable checking for dlopen support. This macro should be used if +the package makes use of the -dlopen and -dlpreopen flags, otherwise +libtool will assume that the system does not support dlopening. +The macro must be called *before* @code{AM_PROG_LIBTOOL}. +@end defmac + +@defmac AC_DISABLE_FAST_INSTALL +Change the default behaviour for @code{AM_PROG_LIBTOOL} to disable +optimization for fast installation. The user may still override +this default by specifying @samp{--enable-fast-install}. +@end defmac + +@defmac AC_DISABLE_SHARED +@defmacx AM_DISABLE_SHARED Change the default behaviour for @code{AM_PROG_LIBTOOL} to disable shared libraries. The user may still override this default by specifying @samp{--enable-shared}. @end defmac -@defmac AM_DISABLE_STATIC +@defmac AC_DISABLE_STATIC +@defmacx AM_DISABLE_STATIC Change the default behaviour for @code{AM_PROG_LIBTOOL} to disable static libraries. The user may still override this default by specifying @samp{--enable-static}. @@ -3594,7 +3611,7 @@ aren't defined in that library. @defvar always_export_symbols Whether libtool should automatically generate a list of exported symbols using @var{export_symbols_cmds} before linking an archive. -Set to @samp{yes} or @samp{no}. Default is @samp{no} +Set to @samp{yes} or @samp{no}. Default is @samp{no}. @end defvar @defvar archive_cmds @@ -3753,6 +3770,12 @@ line (such as @samp{@var{dir}/lib@var{name}.a}) when @var{hardcode_libdir_flag_spec} is specified. @end defvar +@defvar hardcode_into_libs +Whether the platform supports hardcoding of run-paths into libraries. +If enabled, linking of programs will be much simpler but libraries will +need to be relinked during installation. +@end defvar + @defvar hardcode_libdir_flag_spec Flag to hardcode a @var{libdir} variable into a binary, so that the dynamic linker searches @var{libdir} for shared libraries at runtime. @@ -3913,6 +3936,11 @@ this variable to extend the library search path. Linker switches such as @code{-L} also augment the search path. @end defvar +@defvar thread_safe_flag_spec +Linker flag (passed through the C compiler) used to generate thread-safe +libraries. +@end defvar + @defvar version_type The library version numbering type. One of @samp{libtool}, @samp{linux}, @samp{osf}, @samp{sunos}, or @samp{none}. diff --git a/libltdl/Makefile.am b/libltdl/Makefile.am index fd4e05e2..22dfc45b 100644 --- a/libltdl/Makefile.am +++ b/libltdl/Makefile.am @@ -1,5 +1,5 @@ -# A brief demonstration of using Automake with Libtool. -*-Makefile-*- -# +## Process this file with automake to produce Makefile.in + AUTOMAKE_OPTIONS = no-dependencies foreign if INSTALL_LTDL diff --git a/libltdl/configure.in b/libltdl/configure.in index 8eaaede8..0d3b4535 100644 --- a/libltdl/configure.in +++ b/libltdl/configure.in @@ -1,5 +1,5 @@ dnl Process this file with autoconf to create configure. -dnl Initialize the libltdl package. + AC_INIT(ltdl.c) if test -z "$enable_ltdl_install$enable_ltdl_convenience"; then diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 57121563..221da123 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -82,6 +82,8 @@ static const char unknown_error[] = "unknown error"; static const char dlopen_not_supported_error[] = "dlopen support not available"; static const char file_not_found_error[] = "file not found"; static const char no_symbols_error[] = "no symbols defined"; +static const char cannot_open_error[] = "can't open the module"; +static const char cannot_close_error[] = "can't close the module"; static const char symbol_error[] = "symbol not found"; static const char memory_error[] = "not enough memory"; static const char invalid_handle_error[] = "invalid handle"; @@ -204,10 +206,6 @@ strrchr(str, ch) # include #endif -#if ! HAVE_DLERROR /* not all platforms have dlerror() */ -#define dlerror() unknown_error -#endif - #ifdef RTLD_GLOBAL # define LTDL_GLOBAL RTLD_GLOBAL #else @@ -259,7 +257,11 @@ dl_open (handle, filename) { handle->handle = dlopen(filename, LTDL_GLOBAL | LTDL_LAZY_OR_NOW); if (!handle->handle) { +#if HAVE_DLERROR last_error = dlerror(); +#else + last_error = cannot_open_error; +#endif return 1; } return 0; @@ -270,7 +272,11 @@ dl_close (handle) lt_dlhandle handle; { if (dlclose(handle->handle) != 0) { +#if HAVE_DLERROR last_error = dlerror(); +#else + last_error = cannot_close_error; +#endif return 1; } return 0; @@ -284,7 +290,11 @@ dl_sym (handle, symbol) lt_ptr_t address = dlsym(handle->handle, symbol); if (!address) +#if HAVE_DLERROR last_error = dlerror(); +#else + last_error = symbol_error; +#endif return address; } @@ -365,7 +375,7 @@ shl_open (handle, filename) { handle->handle = shl_load(filename, LTDL_BIND_FLAGS, 0L); if (!handle->handle) { - last_error = unknown_error; + last_error = cannot_open_error; return 1; } return 0; @@ -376,7 +386,7 @@ shl_close (handle) lt_dlhandle handle; { if (shl_unload((shl_t) (handle->handle)) != 0) { - last_error = unknown_error; + last_error = cannot_close_error; return 1; } return 0; @@ -391,7 +401,7 @@ shl_sym (handle, symbol) if (shl_findsym((shl_t) (handle->handle), symbol, TYPE_UNDEFINED, &address) != 0 || !(handle->handle) || !address) { - last_error = unknown_error; + last_error = symbol_error; return 0; } return address; @@ -438,7 +448,7 @@ dld_open (handle, filename) return 1; } if (dld_link(filename) != 0) { - last_error = unknown_error; + last_error = cannot_open_error; lt_dlfree(handle->handle); return 1; } @@ -450,7 +460,7 @@ dld_close (handle) lt_dlhandle handle; { if (dld_unlink_by_file((char*)(handle->handle), 1) != 0) { - last_error = unknown_error; + last_error = cannot_close_error; return 1; } lt_dlfree(handle->filename); @@ -465,7 +475,7 @@ dld_sym (handle, symbol) lt_ptr_t address = dld_get_func(symbol); if (!address) - last_error = unknown_error; + last_error = symbol_error; return address; } @@ -504,7 +514,7 @@ wll_open (handle, filename) { handle->handle = LoadLibrary(filename); if (!handle->handle) { - last_error = unknown_error; + last_error = cannot_open_error; return 1; } return 0; @@ -515,7 +525,7 @@ wll_close (handle) lt_dlhandle handle; { if (FreeLibrary(handle->handle) != 0) { - last_error = unknown_error; + last_error = cannot_close_error; return 1; } return 0; @@ -529,7 +539,7 @@ wll_sym (handle, symbol) lt_ptr_t address = GetProcAddress(handle->handle, symbol); if (!address) - last_error = unknown_error; + last_error = symbol_error; return address; } @@ -543,6 +553,84 @@ wll = { LTDL_TYPE_TOP, 0, wll_init, wll_exit, #endif +#ifdef __BEOS__ + +/* dynamic linking for BeOS */ + +#include + +static int +bedl_init () +{ + return 0; +} + +static int +bedl_exit () +{ + return 0; +} + +static int +bedl_open (handle, filename) + lt_dlhandle handle; + const char *filename; +{ + image_id image = 0; + + if (filename) { + image = load_add_on(filename); + } else { + image_info info; + int32 cookie = 0; + if (get_next_image_info(0, &cookie, &info) == B_OK) + image = load_add_on(info.name); + } + if (image <= 0) { + last_error = cannot_open_error; + return 1; + } + handle->handle = (void*) image; + return 0; +} + +static int +bedl_close (handle) + lt_dlhandle handle; +{ + if (unload_add_on((image_id)handle->handle) != B_OK) { + last_error = cannot_close_error; + return 1; + } + return 0; +} + +static lt_ptr_t +bedl_sym (handle, symbol) + lt_dlhandle handle; + const char *symbol; +{ + lt_ptr_t address = 0; + image_id image = (image_id)handle->handle; + + if (get_image_symbol(image, symbol, B_SYMBOL_TYPE_ANY, + &address) != B_OK) { + last_error = symbol_error; + return 0; + } + return address; +} + +static +lt_dltype_t +bedl = { LTDL_TYPE_TOP, 0, bedl_init, bedl_exit, + bedl_open, bedl_close, bedl_sym }; + +#undef LTDL_TYPE_TOP +#define LTDL_TYPE_TOP &bedl + +#endif + /* emulate dynamic linking using preloaded_symbols */ typedef struct lt_dlsymlists_t { @@ -1117,6 +1205,12 @@ lt_dlopen (filename) file = (FILE*) find_file(basename, getenv("LTDL_LIBRARY_PATH"), &dir, 0); +#ifdef __BEOS__ + if (!file) + file = (FILE*) find_file(basename, + getenv("ADDON_PATH"), + &dir, 0); +#endif #ifdef LTDL_SHLIBPATH_VAR if (!file) file = (FILE*) find_file(basename, diff --git a/libtool.m4 b/libtool.m4 index f7661efd..7b3dd461 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -568,9 +568,20 @@ AC_SUBST(USE_SYMBOL_UNDERSCORE)dnl ]) # AC_CHECK_LIBM - check for math library -AC_DEFUN(AC_CHECK_LIBM, [ -AC_CHECK_LIB(mw, _mwvalidcheckl) -AC_CHECK_LIB(m, cos) +AC_DEFUN(AC_CHECK_LIBM, +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +case "$host" in +*-*-beos* | *-*-cygwin*) + # These system don't have libm + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl) + AC_CHECK_LIB(m, cos) + ;; +*) + AC_CHECK_LIB(m, cos) + ;; +esac ]) # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for diff --git a/ltconfig.in b/ltconfig.in index 7d663efb..522c1e2b 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -1628,6 +1628,9 @@ beos*) library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes ;; bsdi4*) @@ -1659,6 +1662,8 @@ cygwin* | mingw*) need_lib_prefix=no # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= ;; freebsd1*) @@ -2138,54 +2143,6 @@ if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then lt_cv_dlopen="shl_load" else echo "$ac_t""no" 1>&6 -echo $ac_n "checking for LoadLibrary""... $ac_c" 1>&6 -echo "$progname:@LINENO@: checking for LoadLibrary" >&5 -if eval "test \"`echo '$''{'ac_cv_func_LoadLibrary'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char LoadLibrary(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_LoadLibrary) || defined (__stub___LoadLibrary) -choke me -#else -LoadLibrary(); -#endif - -; return 0; } -EOF -if { (eval echo $progname:@LINENO@: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_LoadLibrary=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_LoadLibrary=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'LoadLibrary`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="LoadLibrary" -else - echo "$ac_t""no" 1>&6 -fi - - fi diff --git a/ltmain.in b/ltmain.in index 74156c68..fa5f869b 100644 --- a/ltmain.in +++ b/ltmain.in @@ -1621,7 +1621,10 @@ compiler." installed=yes # Read the .la file - . $lib + case "$lib" in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac # Get the name of the library we link against. linklib= @@ -2431,7 +2434,10 @@ EOF installed=yes # Read the .la file - . $lib + case "$lib" in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac # Get the name of the library we link against. linklib= @@ -2556,7 +2562,10 @@ EOF installed=yes # Read the .la file - . $lib + case "$lib" in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac # Get the name of the library we link against. linklib= @@ -3703,7 +3712,10 @@ relink_command=\"$relink_command\"" # Check to see that each library is installed. libdir= if test -f "$lib"; then - . $lib + case "$lib" in + */* | *\\*) . $lib ;; + *) . ./$lib + esac fi libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`" if test -n "$libdir" && test ! -f "$libfile"; then diff --git a/mdemo/Makefile.am b/mdemo/Makefile.am index 67806b88..c6f5f48f 100644 --- a/mdemo/Makefile.am +++ b/mdemo/Makefile.am @@ -1,5 +1,5 @@ -# A brief demonstration of Libtool modules. -*-Makefile-*- -# +## Process this file with automake to produce Makefile.in + AUTOMAKE_OPTIONS = no-dependencies foreign INCLUDES = -I$(srcdir)/../libltdl diff --git a/mdemo/configure.in b/mdemo/configure.in index 1c17ed5b..495670dd 100644 --- a/mdemo/configure.in +++ b/mdemo/configure.in @@ -1,4 +1,5 @@ -dnl Initialize the mdemo package. +dnl Process this file with autoconf to create configure. + AC_INIT(main.c) AM_INIT_AUTOMAKE(mdemo,0.1) diff --git a/tests/Makefile.am b/tests/Makefile.am index 3dd45e8b..23aed736 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,4 +1,4 @@ -## Process this file with automake to create Makefile.in -*-Makefile-*- +## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = gnits