From: Alexandre Oliva Date: Sat, 2 Mar 2002 16:50:29 +0000 (+0000) Subject: merge from head. Omits work in ltmain.in X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b69b3e703b7122754fb7861b69989d92bea0ae52;p=thirdparty%2Flibtool.git merge from head. Omits work in ltmain.in --- diff --git a/AUTHORS b/AUTHORS index 3bf320d86..d29d2ba44 100644 --- a/AUTHORS +++ b/AUTHORS @@ -5,6 +5,7 @@ Foundation. Gordon Matzigkeit. Designed and implemented libtool. Alexandre Oliva . Co-maintainer. Thomas Tanner . Co-maintainer. -Gary V. Vaughan . Co-maintainer. +Gary V. Vaughan . Co-maintainer. Ossama Othman . Co-maintainer. Robert Boehne . Co-maintainer. +Bruce Korb . Binary-Branch maintainer. diff --git a/ChangeLog b/ChangeLog index 25869b73e..556b6c424 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,1694 +1,1123 @@ -2001-05-16 Alan Modra +2002-02-07 Alexandre Oliva - * libtool.m4 (lt_cv_deplibs_check_method): pass_all for hppa*-linux. - -2001-05-03 Andreas Jaeger , Andreas Schwab - - * ltmain.in (relink_command): Arrange for wrapper script to save - output to a variable and display it only if relinking fails. - -2001-04-27 Alexandre Oliva - - * ltcf-cxx.sh: Add -nostdlib to HP-UX GCC archive_cmds. - -2001-04-27 Mark P Mitchell - - * ltcf-cxx.sh: Add -nostdlib to IRIX 6 archive_cmds. - -2001-04-24 Thomas Tanner - - * TODO: describe problems with libltdl - * ltmain.in (ILD): tidy up, add comments, remove dead code, - merge duplicate code - * ltmain.in (ILD): don't touch newdependency_libs after scan or - dlopen pass - * ltmain.in (ILD): don't dlpreopen dependency_libs of a dlopened - module (remove absolutely wrong quick hack) - * ltmain.in (ILD): remove comments about duplicate removal - * ltmain.in (ILD): build a static-only module if it has - static libraries in its dependencies (so that libltdl can - safely load dependency_libs) - * ltmain.in (argument parsing): prefix comparsions of -l args with X, - replace -lc with `-framework System' _after_ the ILD passes - * ltmain.in (deplibs_check): use portable test syntax - * ltmain.in (help): document -prefer-[non-]pic flags - * ltmain.in: improve readablity by adding some comments, - rename uninst_* to notinst_* (more adequate name) - -2001-04-24 Peter Eisentraut - - * ltcf-c.sh, ltcf-gcj.sh: Support $host_os as /sysv5uw7*/ from - newer config.guess in addition to older /unixware*/. Use - compiler driver, not linker, for linking shared libraries. - -2001-04-24 Gary V. Vaughan - - * ltdl.m4 (AC_C_INLINE): No longer required. - * libltdl/ltdl.c (strdup, strcmp, strchr, strrchr, memcpy, trim, - free_vars): Revoke inline keyword from declarations. `static - inline' is not very portable, and in addition Unixware 7.1.1's - compiler says you can't access static variables from inline - functions. - Reported by Peter Eisentraut - -2001-04-24 Albert Chin-A-Young - - * ltconfig.in: Handle case where /bin/nm -p outputs multiple - symbol types (like under HP-UX 11.00). + Reverted incorrect patch: + 2001-10-24 H.J. Lu + * ltmain.sh: Allow link against an archive when building a + shared library. + * libtool.m4 (lt_cv_deplibs_check_method): Always use + file_magic for Linux ELF. -2001-04-24 Ossama Othman +2002-01-30 Robert Boehne - * ltcf-cxx.sh (output_verbose_link_cmds): Renamed this variable to - "output_verbose_link_cmd" to better conform to libtool naming - conventions. + * libtool.m4 (LT_AC_PROG_SED): Removed a mysterious newline. -2001-04-24 Gary V. Vaughan +2002-01-28 Robert Boehne - From Tim Mooney - * tests/Makefile.am (TESTS_ENVIRONMENT): Make sure the *.test - scripts get the same make that was used in the top level - directory. + * libtool.m4 (LT_AC_PROG_SED): New macro tests sed for truncation of + output. AC_REQUIRE the new macro. + * ltmain.in: Use $SED rather than plan old sed, as set by the new + macro LT_AC_PROG_SED. -2001-04-23 Peter Eisentraut +2002-01-10 Volker Christian - * libltdl/ltdl.c (lt_dlexit): Quit loop if only resident modules - are left. - -2001-04-23 Gary V. Vaughan + * libltdl/ltdl.c (find_handle_callback): treat the result of a call + to access(2) correctly when deciding whether a library can be found + in a directory from user_search_path. - From Albert Chin-A-Young - * ltmain.in: `test -L' is not portable, and infact breaks uninstall - mode on Solaris. Fallback to `test -h' and finally `test -f', - but be careful not to let the failure status cause libtool to - stop. +2002-01-07 Robert Boehne - From Simon Spero - * ltdl.m4 (AC_LTDL_DLSYM_USCORE): Add $LIBADD_DL while - checking for dlsym _. + * NEWS: Fixed wrong path for texinfo.tex. + * configure.ac: Bumped version to 1.4e. - From Simon Spero - * libtool.m4 (lt_cv_deplibs_check_method) [darwin]: Set it! + GNU libtool 1.4d was released. - * Makefile.am (EXTRA_DIST): Distribute bootstrap. + * configure.ac: Bumped version to 1.4d. + * NEWS: updated. + * config.guess, config.sub, texinfo.tex: Synchronised from + ftp.gnu.org. -2001-04-22 Peter Eisentraut +2001-12-06 Jens Petersen - * bootstrap: Allow overriding the location aclocal, automake, - autoconf, autoheader from the environment. + * ltmain.in: Replace all test "-a"s by "&& test" + for portability. - * demo/Makefile.am: Automake 1.4e does not allow `+=' assignments - if the variable was not set with `=' earlier. `+=' was not useful - here anyway. +2001-11-28 Robert Boehne -2001-04-22 Gary V. Vaughan + * libtool.m4 (AC_LIBTOOL_SYS_MAX_CMD_LEN): Change the + factor of saftey as 3/4 of the result was not low enough. - * ltdl.m4 (AC_CHECK_HEADERS): UW7 has sys/dl.h, so we must - check for that here. - * libltdl/ltdl.c (HAVE_SYS_DL_H): Include it if necessary for - the dlopen loader. - Reported by Matthew Schalit +2001-11-28 Gary V. Vaughan - * libtool.m4 (AC_DEPLIBS_CHECK_METHOD): Use pass_all for - various releases of UnixWare and OpenServer that support it. - Reported by Matthew Schalit + * libtoolize.in: The test for whether AC_PROG_LIBTOOL is defined + in aclocal.m4 had bitrotted slightly. + Reported by Takahiko Kawasaki -2001-04-21 Gary V. Vaughan +2001-11-27 Donald D. Anderson - * TODO: propose pkg-config merge. + * ltmain.in: Treat freebsd like openbsd, in that -lc/-lc_r should + not be explicitly used. ld handles this depending on the presence + of the -pthread option. -2001-04-21 Nick Hudson +2001-11-27 Robert Boehne - * ltmain.in: Correct an error in yesterday's patch. + With help from Michael Matz : + * ltmain.in: Add a new command line argument + --preserve-dup-deps for preserving duplicate + dependent libraries. + * libtool.texi: Document it. -2001-04-20 Nick Hudson +2001-11-27 Kevin Ryde - * libtool.m4: Improve NetBSD support. - * ltcf-c.sh: ditto. - * ltcf-gcj.sh: ditto. - * ltmain.in: ditto. - -2001-04-20 Alexandre Oliva + * libtool.m4 (AC_LIBTOOL_SYS_MAX_CMD_LEN): Send "test" + warnings to /dev/null, helps FreeBSD and maybe others. - * ltcf-cxx.sh [HP-UX GNU ld]: Don't use flags specific to the - HP-UX linker. +2001-11-15 Albert Chin-A-Young -2001-04-18 Alexandre Oliva + * libtool.m4: quote LTCC because autoconf AC_PROG_CC_STDC + macro might add to $CC if options needed by compiler to + grok ANSI. - * TODO: Add -L- flag. +2001-11-15 Gary V. Vaughan -2001-04-11 Alexandre Oliva + From Joseph S. Myers : + * ltmain.in: Typo. - * ltcf-c.sh (no_undefined_flag) [Solaris ld]: Change to -zdefs. - * ltcf-cxx.sh (no_undefined_flag) [Solaris ld]: Likewise. - * ltcf-gcj.sh (no_undefined_flag) [Solaris ld]: Likewise. - (archive_cmds, archive_expsym_cmds, output_verbose_link_cmds, - whole_archive_flag_spec) [Solaris]: Copy from ltcf-cxx.sh. +2001-11-15 Mo DeJong -2001-04-11 Michael Matz + * ltmain.in: Place parens around a generated relink_command + so it is run is a subshell. This avoids an install error + where libtool ended up in the wrong directory after + relinking a .la file. - * ltmain.in: Recognize "CC" as default --tag argument to resolve - also ambiguities with that language. +2001-10-31 Raja R Harinath -2001-04-11 Alexandre Oliva + * configure.ac (pkgdatadir): Move the invocation of AC_INIT_AUTOMAKE + before the use of $PACKAGE in $pkgdatadir. + Reported by Bob Friesenhahn - * ltmain.in: Mark duplicate libraries appearing in predeps and - postdeps as specialdeplibs. Explain the whole plan. +2001-10-28 Gary V. Vaughan -2001-04-11 Ossama Othman + From Tom Bates : + * libtool.m4 [mips-compaq-nonstopux]: New port. + * ltmain.in [mips-compaq-nonstopux]: Support + $version_type == nonstopux. - * config.guess: Updated to latest version. - * config.sub: Likewise. +2001-10-28 Albert Chin-A-Young -2001-04-11 Loren J. Rittle + * libltdl/ltdl.c (foreach_dirinpath): change some types to size_t + from int because strlen() returns size_t. argz_len changed to + size_t because argzize_path() takes 3rd argument as size_t, not + int. + Based on lint run from Bob Friesenhahn - * ltcf-cxx.sh: Support creation of C++ shared libraries on - recent versions of FreeBSD (release 3 or later). - * ltconfig.in: On FreeBSD, -lc must not be provided when building - a shared library or else the standard -pthread gcc option is - rendered worthless to later users of the built library. +2001-10-27 Gary V. Vaughan -2001-04-11 Ossama Othman + * libtool.m4 (_LT_AC_TAGCONFIG): Cray sed does not allow character + sets to contain the separator character. + Reported by Kevin Ryde - * AUTHORS: Added myself to the list of maintainers. + * ltdl.m4 (AC_WITH_LTDL): New macro to add `--with-included-ltdl' + option to configure, but to find an appropriate ltdl library and + append the right options to link it. -2001-04-10 Aneesh Kumar K.V +2001-10-24 Kevin Ryde - * ltcf-cxx.sh (archive_expsym_cmds, osf4/osf5): Added support - for cxx under Compaq Tru64. + * libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS): Remove a stray ' quote. -2001-04-08 Gary V. Vaughan +2001-10-24 H.J. Lu - * ltcf-c.sh (hardcode_libdir_flag_spec, osf4/osf5): Use ${wl} - to pass -rpath when compiling with gcc. - Reported by Tim Mooney + * ltmain.sh: Allow link against an archive when building a + shared library. + * libtool.m4 (lt_cv_deplibs_check_method): Always use + file_magic for Linux ELF. + +2001-10-12 Guido Draheim + + * ltdl.m4: Changed "underscode to underscore". + +2001-10-06 Gary V. Vaughan + + * configure.ac: General modernisation and cleanup. + * cdemo/configure.ac: Ditto. + * demo/configure.ac: Ditto. + * depdemo/configrue.ac: Ditto. + * ltdl/configure.ac: Ditto. + * ltdldemo/configure.ac: Ditto. + * mdemo/configure.ac: Ditto. + * pdemo/configure.ac: Ditto. + * tagdemo/configure.ac: Ditto. + +2001-10-04 Albert Chin-A-Young + + * libltdl/ltdl.c: Match function return type with prototype + (add static initializer to file_not_found). + +2001-09-30 Gary V. Vaughan + + * libtool.m4 (AC_LIBLTDL_CONVENIENCE): s/INCLTDL/LTDLINCL/ for + consistency with gettext's INTLINCL. Keep the old symbol too for + backwards compatibility. + (AC_LIBLTDL_INSTALLABLE): Ditto. + * doc/libtool.texi (Distributing libltdl): Adjust documentation. + +2001-09-22 Albert Chin-A-Young + + * ltdl.m4 (AC_LTDL_DLLIB): Even though HP-UX 10.20 and 11.00 + support shl_load *and* dlopen, dlopen works correctly only + with a patch. Because we want to avoid the situation where we + build on a system with the patch but deploy on a system without, + use shl_load exclusively if found. + +2001-09-22 Gary V. Vaughan + + * libtool.m4 (_LT_AC_FILE_LTDLL_C): Be carefule that the start + marker searched for by sed must start in column 0. + (_LT_AC_FILE_IMPGEN_C): Ditto. + Reported by Tor Lillqvist + +2001-09-22 Tor Lillqvist + + * libtool.m4 [mingw* cygwin*]: Small improvement for mingw-hosted + tool support (while still running libtool on cygwin). In that case + PATH_SEPARATOR is ':', but gcc -print-search-dirs still prints its + search path with ';' as separator. + (AC_LIBTOOL_RC, AC_LIBTOOL_LANG_RC_CONFIG): Add support for .rc + files (Windows resource files), compiled by the resource compiler + (windres in mingw) to .o files. + (AC_PROG_NM): Minor bug fix for $PATH elements with spaces in + them. + * configure.ac: Use LT_AC_PROG_RC. + * ltmain.in: Check for .rc files. + * NEWS: Updated. - * libltdl/ltdl.c (sys_shl_open): Cache a handle for the `self' - module, since HPUX adds module symbols into the `self' pool if - it is opened later. Return the cached pointer if the caller - subsequently tries to open `self'. - (sys_shl_sym): Diagnose NULL modules. + * ltmain.in: Add a space to $base_compile in the case statement, + as the case labels checks for trailing spaces, but there aren't + necessarily in $base_compile. - From Peter Eisentraut - * ltmain.in (clean,uninstall): test -e is not portable. Well, - neither is -L, but I'm hoping that redirecting error messages - to /dev/null and relying on non-zero exit status will work okay - on the few hosts that don't support -L. +2001-09-22 Albert Chin-A-Young -2001-04-08 Nick Hudson + * libtool.m4: When setting archive_cmds for CC, don't + test for $GXX but for $GCC on HP-UX. Indentation fixes. - * ltmain.in: Improve check for valid -version-info parameter. +2001-09-21 Gary V. Vaughan -2001-04-08 Gary V. Vaughan + From Tor Lillqvist : + * ltmain.in [cygwin* mingw*]: Take care of the difference between + wrapper script name and executable name. - From Nick Hudson - * doc/Makefile.am (libtool_TEXINFOS): Add fdl.texi so that it - is included in the distribution. + * libtool.m4 (archive_cmds) [darwin1.[0-2]]: Darwin uses zsh-3.1.6 + for /bin/sh, and that shell does not handle escaped quotes + properly yet. + Reported by Christopher Pfisterer -2001-04-07 Peter Eisentraut +2001-09-21 Albert Chin-A-Young - * ltmain.in (clean,uninstall): Do not error if the file doesn't - exist and 'rm -f' was used. Exit with status 1 on error. + * libltdl/ltdl.c: Match function return type with prototype + (add static initializer to some functions) to prevent warnings + from HP-UX cc. -2001-04-06 Nick Hudson +2001-09-21 Gary V. Vaughan - * ltmain.in: Implement a new deplibs_check_method called - match_pattern that does pattern matching on filenames... - * libtool.m4: ...use it with NetBSD + * libltdl/ltdl.c: Added support for dmalloc, and uncovered some + memory bugs as a result. -2001-04-05 Gary V. Vaughan +2001-09-21 Albert Chin - * doc/libtool.texi (Multiple dependencies): A note about the - problems I've reintroduced by reverting the my patch of 2001-03-31. + * libtool.m4: Don't include main() when testing for command to + parse $NM output because some C++ compilers don't allow you to + take the address of main (e.g. HP-UX aCC). - * tests/Makefile.am (TESTS): Delete references to depdemo-dups.test. - * tests/depdemo-dups.test: Removed, as part of the patch - reversion below. - * ltmain.in: Revert my change from 2001-03-31. Although it - was technically correct, it opens a whole can of worms we don't - want to deal with right now. + * libtool.m4: Some uses of $GXX were unquoted, but GXX is either + NULL or yes. Use "$GXX". - From Ahmed Masud - * libltdl/ltdl.c (sys_shl_open): Return a NULL module handle - for self opening. - (sys_shl_close): Be careful not to close a NULL module handle. - (sys_shl_sym): Allow shl_findsym() to open NULL modules, but - discard the modified module address it returns. +2001-09-13 Assar Westerlund - * libltdl/ltdl.c (lt_dlopen): When reading the .la file, - reallocate the line buffer size if the line overflows the - original buffer. - Reported by Nick Hudson + * ltdl.m4 (AC_LTDL_DLLIB): call dlopen with arguments so the test + does not fail due to a prototype in dlfcn.h - * NEWS (1.3d) Removed bogus ltconfig reference. +2001-09-13 Gary V. Vaughan -2001-03-23 Robert Boehne + * ltdl.m4 (AC_CHECK_HEADERS): Check for assert.h. + * libltdl/ltdl.c: If not, disable assertions manually. - * bootstrap, configure.in: Added references to configure the new - piecewise linking tests. - * tests/pdemo-conf.test, tests/pdemo-exec.test, - tests/pdemo-inst.test, tests/pdemo-make.test: New files. - These tests are similar to the 'demo' tests, but use - piecewise linking with the maximum length of command line - arguments set to 24 characters. - * pdemo/Makefile.am, pdemo/configure, pdemo/configure.in, - pdemo/foo.h, pdemo/longer_file_name_dlmain.c, - pdemo/longer_file_name_foo.c, pdemo/longer_file_name_foo2.c, - pdemo/longer_file_name_hell1.c, pdemo/longer_file_name_hell2.c, - pdemo/longer_file_name_hello.c, pdemo/longer_file_name_main.c: - New files used to test piecewise linking. - * tests/Makefile.am (TESTS): Use the new tests above. +2001-09-11 Gary V. Vaughan + * bootstrap: Be robust to having no files that need removing. -2001-04-01 Christoph Pfisterer + * libltdl/configure.ac (AM_INIT_AUTOMAKE): Bump libltdl version to + 1.2. + * libltdl/Makefile.am (libltdl_la_LDFLAGS): Bump libtool library + version info to 4:0:1. - * libtool.m4, ltconfig.in, ltcf-c.sh, ltcf-cxx.sh: Fixed - support for Darwin and Rhapsody. Now correctly hardcodes the - library path and adds versioning. Other small fixes. - * ltmain.in: Fixed special cases for libc and libm on Rhapsody and - Darwin. One of them was misplaced. Added version_type case for - Rhapsody and Darwin, named "darwin". +2001-09-11 Gary V. Vaughan -2001-03-31 Gary V. Vaughan + * libtool.m4: No need to undefine([symbols]), proper quotation is + enough. - * ltmain.in: Remove the code for stripping duplicate deplibs - from libtool link lines -- duplicates are somtimes necessary - to satisfy inter-library dependencies, and never cause link to - fail even if they are spurious. - * tests/depdemo-dups.test: New file. Make sure this bug doesn't - creep back in again! - * tests/Makefile.am (TESTS): Use the new test above. +2001-09-10 Gary V. Vaughan -2001-03-29 Edward M. Lee + * libtool.m4: CVS Autoconf guarantees a decent default IFS, so + there is no need for us to preset it anymore. + Be careful not to set IFS="${IFS}$PATH_SEPARATOR" for PATH + splitting, otherwise spaces in directory names will be lost. + Use $PATH_SEPARATOR... don't rely on $ac_path_separator, which was + an autoconf internal until just now, when it disappeared! + * ltmain.in: Default IFS once, at the start. + Reported by Akim Demaille - * libtoolize.in: Check configure.ac and prefer configure.ac to - configure.in. - - * libtoolize.in: change recommendation from AM_PROG_LIBTOOL to - AC_PROG_LIBTOOL. +2001-09-10 Brad - * ltconfig.in, ltcf-c.sh, ltcf-gcj.sh: Generate dll/import - libraries for cygwin according to the following: libFOO.a (static - lib), libFOO.dll.a (import lib), cygFOO-version.dll (dll). Update - postinstall_cmds and postuninstall_cmds to reflect this. - * ltmain.in: Generate installed .la files with dlnames set to - ../bin/cygFOO-version.dll for normal dlls. dlls for modules - remain with the .la file. + * libtool.m4 (AC_DEPLIBS_CHECK_METHOD): Missed an instance of + Autoconf square bracket quoting style normalisation. - * libltdl/ltdl.c: Use windows paths while calling LoadLibrary. - -2001-03-22 Laurynas Biveinis + * ltmain.in (-lc_r): Style improvement. - * ltcf-c.sh: Clear ac_cv_prog_cc_pic for DJGPP. Do not add - '-DPIC' to ac_cv_prog_cc_pic for DJGPP. - * ltcf-cxx.sh: Likewise. - * ltcf-gcj.sh: Likewise. - * ltconfig.in: Fix typo. + * doc/libtool.texi: Remove obsolete references to ltconfig. + * tests/quote.test: s/ltconfig/\$0/ -2001-03-20 Alexandre Oliva +2001-09-09 Gary V. Vaughan - * ltmain.in (piecewise linking): Make sure we link at least one - object file at a time into a new reloadable object file. - [whole_archive_flag_spec]: Don't link convenience archives - piecewise. - (piecewise archiving): Clear RANLIB except for the last run. + * libtool.m4: Use Autoconf square bracket quoting style + consistently throughout. -2001-03-20 Alexandre Oliva +2001-09-08 Gary V. Vaughan - * configure.in (file_magic_cmd, reload_flag): Duplicate `$'s - before SUBSTin in the Makefile. - * ltconfig.in (reload_flag): Prepend a blank if it doesn't start - with one. - -2001-03-16 Albert Chin - - * ltcf-cxx.sh (archive_cmds) [HP-UX, GCC]: Link with -fPIC. + * bootstrap: Cleanup `autom4te' and `libtool' so that we don't + get caught by something from a previous build. -2001-03-13 Alexandre Oliva + * libtool.m4 (archive_cmds, archive_expsym_cmds) [solaris*]: Revert + my 2001-09-06 patch. + (no_undefined_flag)i [solaris*]: Revert Alexandre's 2001-04-11 patch. - * ltconfig.in (lt_cv_compiler_c_o): Cache it. - * ltcf-gcj.sh (lt_cv_compiler_c_o): Set it. +2001-09-07 Gary V. Vaughan -2001-03-10 Peter Eisentraut + * libltdl/ltdl.c (foreach_dirinpath): argz_len should be a size_t. + Reported by Albert Chin - * ltmain.in (clean): Fix wrong variable use. +2001-09-06 Gary V. Vaughan -2001-02-25 Peter Eisentraut + * libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS) [solaris*]: Typo. s/GXX/GCC/. - * ltmain.in (clean): Automatically remove $objdir (usually '.libs'). + * libtool.m4 (archive_cmds, archive_expsym_cmds) [solaris*]: Changing + no_undefined_flag from `-z text' to `-z defs' (see entry below at + 2001-04-11 Alexandre Oliva ) has a problem. + when linking a shared library with gcc calling /usr/ccs/bin/ld (eg. + the gcc supplied with Solaris 8 companion CD), using the flag + -no-undefined, shared library linking will always fail because of + the unresolved symbols from libgcc.a. Consequently we have to + provide a path to libgcc.a when linking shared libraries in + conjunction with -no-undefined! -2001-03-08 Gary V. Vaughan + From Michael Pruett : + * libltdl/ltdl.c (find_module): `0' valued arguments to + tryall_dlopen_module() must be explicitly cast to avoid compiler + warnings on some environments. - * ltconfig.in (library_names_spec): Undo latin-1 spaces I pasted - in yesterday by mistake. - -2001-03-07 Gary V. Vaughan - - From Tor Lillqvist - * ltcf-c.sh, ltcf-gcj.sh (export_symbols): On Windows, if the - export_symbols file (which has been passed to libtool with the - -export-symbols command line switch) already is a .def file, use - it as is. + From Daniel Johnson : + * libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS) [darwin*]: Move from GNU + ld section to non-GNU ld section. - From Tor Lillqvist - * ltconfig.in (library_names_spec): Use an appropriate filename - prefix for dlls -- lib for mingw; cyg for cygwin; pw for pw32. +2001-09-05 Robert Boehne -2001-03-06 Alexandre Oliva + * pdemo/Makefile.am (helldl): Automake 1.4 can't find the target + if we use helldl$(EXEEXT), and Automake 1.5 barfs unless we do. + Using both targets to the left of the colon seems to work though! - * ltconfig.in (can_build_shared) [AIX 4.[01], GCC]: GCC up to - 2.96 can't build shared libraries reliably. Disable them. +2001-09-03 Gary V. Vaughan - * ltmain.in: When dropping dependencies of a -no-undefined - library, give up on building a shared library. + * demo/Makefile.am (helldl): Automake 1.4 can't find the target + if we use helldl$(EXEEXT), and Automake 1.5 barfs unless we do. + Using both targets to the left of the colon seems to work though! - * ltcf-cxx.sh (archive_cmds) [HP-UX, GCC]: Port. +2001-09-03 Brad -2001-03-06 Gary Vaughan + * ltdl.m4 [AC_LTDL_SYS_DLOPEN_DEPLIBS]: Teach ltdl about the + behavior of OpenBSD's dlopen(). - From Albert Chin-A-Young - * libtool.m4: Apply missing m4 quotes that were originally applied to - HEAD branch only. - -2001-03-05 Gary Vaughan +2001-09-03 Gary V. Vaughan - * NEWS: Updated. - * doc/libtool.texi (Thread Safety in libltdl): New node describing - the application the new MT API. - * libltdl/ltdl.h: Prototypes. - * libltdl/ltdl.c: Use these functions throughout the rest of - the file to provide thread locking. - (lt_dlmutex_register): New function to set callbacks for - multi-threaded calls into libltdl. - (lt_dl_mutex_lock): Type of a locking callback function. - (lt_dl_mutex_lock): Type of an unlocking callback function. - (lt_dl_mutex_seterror): Type of a callback function to save the - last libltdl error message in thread local storage. - (lt_dl_mutex_geterror): Type of a callback function to retrieve - the last saved error message from thread local storage. - -2001-03-05 Akim Demaille - - * ltmain.sh: Don't quote the argument of case/esac and - assignments. - * libtool.m4: Likewise. - * ltconfig.in: Likewise. - * ltcf-c.sh: Likewise. - * ltcf-cxx.sh: Likewise. - * ltcf-gcj.sh: Likewise. - -2001-03-05 Robert Boehne - - * ltmain.in: Add support for the -objectlist option in - link mode. The option behaves identically to the IRIX - 6.5 linker option of the same name. Added a description - of the -objectlist option to the output of - libtool --mode=link --help - * doc/libtool.texi (Link mode): Added documentation for - the -objectlist option in libtool link mode. - -2001-03-03 Markus F.X.J. Oberhumer , - Alexandre Oliva - - * ltconfig.in: Added explicit return type to all C functions. - * ltdl.m4: Likewise. - -2001-02-22 Robert Boehne - - * ltconfig.in: Add a test to find the approximate limit - to the length of command line arguments. The number - calculated here should always be lower than the actual - limit. - * ltmain.in: Test the length of the command line to be - executed and use an incremtnal linking scheme if the - command is too long to be interpreted without error. - * doc: Test the length of the command line to be - executed and use an incremtnal linking scheme if the - command is too long to be interpreted without error. - * doc/libtool.texi (Reloadable Objects): Added a few - sentences to describe how piecewise linking is done - for shared objects by creating reloadable object files. - -2001-02-20 Gary Vaughan - - * libltdl/ltdl.c (lt_dlcaller_register): dont set an unsigned - type to a negative number. - Reported by Guenter Millahn - - -2001-02-15 Robert Boehne - - * ltconfig.in: Under AIX 4&5 check to see if we're using - GNU nm, if so, remove -C from the options to $NM. The -C - is required to demangle with AIX nm, but -C means don't - demangle to GNU nm. - -2001-02-15 Robert Boehne - - * ltcf-cxx.sh: Only check for broken collect2 under - AIX 4.[012], the check only works on these OS versions. - - * ltcf-c.sh: Ditto. - - * ltcf-gcj.sh: Ditto. + From Marius Vollmer : + * libltdl/ltdl.c (tryall_dlopen_module): Don't forget to propogate + errors over recurse levels. -2001-02-12 Robert Boehne +2001-09-03 Brad - * libtool.m4: Removed the AC_REQUIRE of - AC_PROG_LIBTOOL from AC_LIBTOOL_CXX. - This caused a circular dependency using - CVS autoconf on the tagdemo directory. + * libtool.m4 [openbsd*]: More improvements to the OpenBSD port. -2001-02-12 Robert Boehne +2001-09-02 Gary V. Vaughan - * libtool.m4: Changed aix4* to aix* to set - deplibs_check_method to pass_all for all aix. - This should have been part of the patch below. + From Albert Chin : + * libtool.m4 (_LT_AC_LANG_C_CONFIG) [aix4*]: Be careful with + shared namespaces for static and shared libs. + (AC_LIBTOOL_DLOPEN_SELF): If all else fails, try dld_link from GNU + DLD. -2001-02-12 Robert Boehne - - * ltcf-cxx.sh: Added support for g++ under - AIX 4 and 5 on Power* and IA64. - - * ltcf-c.sh: Added support for gcc under - AIX 4 and 5 on Power* and IA64 - - * ltcf-gcj.sh: Ditto. - - * ltconfig.in: The export_symbols_cmds had to be - specifically changed under AIX. - -2001-01-31 Robert Boehne +2001-09-02 Christopher Pfisterer - * ltcf-cxx.sh: Eliminated setting LD to $CC + * libtool.m4, ltmain.in: Linker flag and version numbering fixes + for darwin. -2001-02-05 Gary V. Vaughan +2001-09-02 Gary V. Vaughan - From Nick Hudson - * ltdl.m4 (AC_LTDL_SYS_DLOPEN_DEPLIBS): netbsd* is able to - automatically load module deplibs without assistance from - libltdl. - -2001-02-02 Gary V. Vaughan + Based on a patch from Marius Vollmer : + * NEWS: updated. + * ltdl.m4 (AC_LIB_LTDL): Check for unistd.h. + * ltdl.c: Include unistd.h if it exists. + (LTDL_SEARCHPATH_VAR): Macro to prevent hardcoding + "LTDL_LIBRARY_PATH". + (LTDL_ARCHIVE_EXT): Macro to prevent hardcoding ".la". + (archive_ext): Have only one copy of ".la" in the readonly + segment of the compiled library. + (find_handle_callback): Don't bother trying to dlopen the file if + it doesn't exist. + (find_handle): Don't bother searching for files if no search_path + was supplied. + (file_not_found): A new function to determine whether the last + error was due to a file not found condition. + (try_dlopen): Renamed from lt_dlopen() and changed to have the + same footprint as tryall_dlopen. This involved a minor rewrite of + much of the internals of this function. + (lt_dlopen): A new function wrapped arounf try_dlopen(). + (lt_dlopenext): If a file already has a suitable extension, don't + bother adding additional extensions and trying to open those. + Tidy up the rest of the code to prevent continued searching with + an eventual FILE_NOT_FOUND when a genuine failure earlier in the + search process could be legitimately reported. + + * demo/Makefile.am (helldl$(EXEEXT)): Automake-1.5 made me change + this from just `helldl'. + +2001-07-31 Robert Boehne + + * libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS) Fixed a problem + with export_symbols_cmds not being set for CXX tags, and + not being properly set for any tag under AIX/Power. + +2001-08-19 Ossama Othman + + * libtool.m4 (AC_LIBTOOL_LANG_CXX_CONFIG): Corrected and improved + error message that is displayed when there was a problem + compiling the C++ test program. It still mentioned the now + non-existent `ltcf-cxx.sh' file. + + * doc/libtool.texi (LTDL_SET_PRELOADED_SYMBOLS): Removed + parentheses at end of starting "defmac" line, as pointed out by + makeinfo. + +2001-08-18 Brad + + * ltmain.in: Do not remove -lm from deplibs for OpenBSD. + +2001-08-16 Gary V. Vaughan + + * libltdl/ltdl.c (argz_create_sep): Don't forget to include the + terminating '\0' when counting argz_len. + (argz_create_sep): When canonicalizing argz, don't forget to copy + the terminating '\0', incase canonicalization has shortened argz. + (argz_stringify): Don't covert the final '\0' to a separator. + +2001-08-15 Gary V. Vaughan + + * libltdl/ltdl.c (lt_dlhandle_next): Now we can loop through all + loaded module handles as originally intended. + + * libltdl/ltdl.c (lt_dlseterror): Oops. This never worked + either, due to a pair of typos. Now fixed. + + * libltdl/ltdl.c (N_ELEMENTS): Deleted. How come nobody noticed + there was no way this could have ever worked? + (lt_dlcaller_set_data): Now that valid caller_ids must be + non-zero, allocate an addition entry in the caller_data vector and + use a zero valued key as the end marker. + (lt_dlcaller_get_data): Iterate up to the end marker in one pass. + +2001-08-14 Gary V. Vaughan + + * libltdl/ltdl.c (lt_dlcaller_register): Caller ids are allocated + starting from value `1', so that clients can use a value of zero + to indicate that libltdl has not yet initialised. + + * ltmain.in (exec_cmd): Fix quoting in execute mode so that the + double quotes added by libtool (to prevent lossage with embedded + spaces in filenames etc.) are not interpreted as literals by the + shell. + +2001-08-13 Gary V. Vaughan + + * libltdl/ltdl.c (find_file_callback): Fix a multiple free() + bug. + (tryall_dlopen_module): Remove some unused variables. + + * libltdl/ltdl.c (lt_dlinsertsearchdir): Calculate the address + of the end of user_search_path correctly. + + * libltdl/ltdl.c (rpl_argz_stringify): New fallback implementation. + * ltdl.m4 (AC_LTDL_FUNC_ARGZ): Test for argz_stringify in libc. + * libltdl/ltdl.c (lt_argz_insertinorder): Renamed from + lt_argz_insert to make room for... + (lt_argz_insert): Wraps argz_insert with libltdl error handling. + (lt_dlpath_insertdir): Insert new path elements into an + argzized path. + (lt_dlinsertsearchdir): New function to insert new search + directories anywhere into user_search_path using the above. + (lt_dladdsearchdir): Rewritten to use lt_dlpath_insertdir. + * libltdl/ltdl.h (lt_dlinsertsearchdir): Prototype for export. + * doc/libtool.texi (Libltdl interface): Document it. + * NEWS: Updated, - * libltdl/ltdl.c (load_deplibs): Make sure the depcount is reset, - even when deplibs are not used because of the patch below. +2001-08-07 Gary V. Vaughan - * ltdl.m4 (AC_LTDL_SYS_DLOPEN_DEPLIBS): If we know that the host - architecture automatically loads deplibs, then... - * libltdl/ltdl.c (load_deplibs): ...don't manually load each one. + From Albert Chin : + * ltmain.in [irix*]: $with_gcc is either "yes" or "" (empty string) + with current autoconf, so we need to be robust to that when testing + it, -2001-02-02 Robert Boehne +2001-08-06 Gary V. Vaughan - * ltconfig.in: Removed a line break that caused sh.test - to fail. + From Brad : + * libtool.m4 (deplibs_check_method) [aix*]: Removed redundant setting + of this variable. -2001-01-31 Robert Boehne +2001-08-05 Gary V. Vaughan - * AUTHORS: added myself to the list of maintainers. + * libltdl/ltdl.c (load_deplibs): Insert missing 1st argument to + LT_EMALLOC. -2001-01-31 Gary V. Vaughan +2001-08-05 Tim Van Holder + + * ltdl.m4: Canonicalize descriptive text used with + AC_DEFINE. - * libltdl/ltdl.c (load_deplibs): If loading a deplib fails, - don't sweat -- it may be a lib that is already statically linked - into the loading application. + * libtool.m4 (_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR): Remove. + (_LT_AC_PROG_ECHO_BACKSLASH): Use $ac_path_separator + instead of $PATH_SEPARATOR. + (AC_LIBTOOL_SYS_DYNAMIC_LINKER): Ditto. + (_LT_AC_TAGCONFIG): Ditto. + (AC_ENABLE_SHARED): Ditto. + (AC_ENABLE_STATIC): Ditto. + (AC_ENABLE_FAST_INSTALL): Ditto. + (AC_PATH_TOOL_PREFIX): Ditto. + (AC_PATH_MAGIC): Ditto. + (AC_PROG_LD): Ditto. + (AC_PROG_NM): Ditto. + * ltdl.m4 (AC_LTDL_SYSSEARCHPATH): Ditto. - * libltdl/ltdl.c: Clean up the shadowing of the global handles - variable. - (LT_DLRESIDENT_FLAGS): Add extra parens to satisfy -Wall. - (load_deplibs): Cast isspace() argument to an int to satisfy - -Wall. +2001-08-05 Gary V. Vaughan -2001-01-29 Alexandre Oliva + From Brad : + * libtool.m4 (AC_LIBTOOL_SYS_DYNAMIC_LINKER) [openbsd]: OpenBSD + can build modules without a `lib' prefix and version number. + Move the deplibs check code from here... + (AC_DEPLIBS_CHECK_METHOD): ...to here. - * libltdl/Makefile.am (CLEANFILES): Clean conditionally-built - libraries. +2001-08-05 Tim Mooney -2001-01-27 Alexandre Oliva + * libtool.m4 [osf3*, osf4*, osf5*]: Tru64 *can* build modules + without a `lib' prefix to the module name. - * ltcf-c.sh (ld_shlibs) [aix5*]: Disable on unknown CPU types. - * ltcf-cxx.sh, ltcf-gcj.sh: Likewise. +2001-08-05 Gary V. Vuaghan -2001-01-27 Michael Sokolov + From Guido Draheim : + * ltmain.in: Display better and different error messages when + library linkage fails in various ways. - * ltcf-cxx.sh (ac_cv_prog_cc_pic_works, ac_cv_prog_cc_static_works): - Don't unset, it's non-portable and no longer necessary, set to empty - instead. +2001-08-05 Albert Chin-A-Young + + * libtool.m4 (_LT_AC_SYS_LIBPATH_AIX): Add newline after + terminating '}' grouping character. Change '[0-9][0-9]' + to '0' as we've already matched it. + +2001-08-05 Gary V. Vaughan + + From Brad : + * libtool.m4 (archive_cmds) [darwin, newsos, sysv4]: Replace + 1.3 era $linkopts references with $linker_flags. + + * libltdl/ltdl.c: Fixed several careless mistakes in the + foreach_dirinpath support functions. + (foreach_dirinpath): Walk path elements with the argz API. + +2001-08-04 Gary V. Vaughan + + From Sedi Master Albert Chin : + * libtool.m4 (_LT_AC_SYS_LIBPATH_AIX): Replace the awk invocation + with an equivalent bit of sed wizardry. + + From Edouard G. Parmelan + * libtool.m4 [darwin, openbsd]: Fix quoting problems with + unquoted [] expressions. + +2001-08-03 Gary V. Vaughan + + * bootstrap: s/ltdldemo // -- This demo soesn't work properly, + so I haven't committed it yet. + +2001-08-01 Ossama Othman + + * libtool.m4 (AC_LIBTOOL_SETUP): Require Autoconf-2.50 via the + AC_PREREQ autoconf macro since the new libtool macros utilize + macros from that version of Autoconf. + +2001-08-01 Gary V. Vaughan -2001-01-27 Michael Sokolov , Alexandre Oliva + * ltdl.m4: Bump serial number. + General reformat and tify up in line with Autoconf-2.50 support. + (AC_LTDL_FUNC_ARGZ): Test for system implementations of a + handful of argz API calls, the error_t type, and the argz.h + header. + * libltdl/configure.ac (AM_INIT_AUTOMAKE): Bump version number. + * libltdl/ltdl.c (rpl_argz_append, rpl_argz_create_sep. + rpl_argz_insert, rpl_rgz_next): Fallback implementations of + the similarly named functions for machines that don;t use glibc. + (lt_dlrealloc): New memory function pointer that can be set by + the client. Defaults to rpl_realloc, which in turn uses only + lt_dlmalloc and lt_dlfree. + (LT_EMALLOC, LT_EREALLOC): Set internal out-of-memory error + inside the functions called by these new macros. Simplified all + callers by removing explicit client error reporting. + (memmove): Fallback implementation of overlap safe memory copy + function. + (tryall_dlopen): Factorized common code into... + (tryall_dlopen_module): ...this new helper function. + (canonicalize_path): Changed function signature to return success + or failure. Updated all callers. + (foreachfile_callback): Make use of argz API. + (LT_DLSTRLEN): Moved from here... + * libltdl/ltdl.h (LT_STRLEN): ...to here. Updated all callers. + (lt_dlrealloc): Declare new memory management handle. + +2001-07-31 Robert Boehne + + * libtool.m4 (mingw*) Revert the previous change as it was + applied by mistake. + +2001-07-31 Guido Draheim + + * libtool.m4 (mingw*) sys_lib_search_path_spec: + Sets the proper path separator for cross-compiling. - * ltconfig.in: Shell portability fix for the tagname validity check. +2001-07-30 Steve Ellcey -2001-01-25 Michael Sokolov + * libtool.m4 (ia64-*-hpux*) Add support for ia64*-*-hpux* platform. - * ltcf-cxx.sh: Use parentheses around eval $ac_compile. +2001-07-30 Robert Boehne -2001-01-24 Alexandre Oliva + * libtool.m4 (AC_LIBTOOL_PROG_COMPILER_PIC) [aix*]: Fixed an + incorrect resetting of lt_prog_compiler_static when using gcc + under AIX Power. - * ltmain.in (TAG disable-shared, TAG disable-static): Make sure we - keep at least one of build_libtool_libs or build_old_libs set to - yes. +2001-07-31 Gary V. Vaughan - * ltcf-gcj.sh (lt_simple_link_test_code): Remove stray `(0)'. - * libtool.m4 (_AC_LIBTOOL_GCJ): Pass $CPPFLAGS on. + * bootstrap: Remove generated files (incase they are links) before + rerunning the autotools to regenerate them. -2001-01-07 Gary V. Vaughan +2001-07-30 Gary V. Vaughan + * libtool.m4 (AC_LIBTOOL_SETUP): Use Autoconf-2.50 era + quadrigraphs and AC_HELP_STRING to bring AC_ARG_WITH/ENABLE + macros up to date. + (_LT_AC_LOCK): Ditto. + (_LT_AC_TAGCONFIG): Ditto. + (AC_PROG_LD): Ditto. + (AC_ENABLE_SHARED): Ditto. And eliminate the last remaining + changequote invocations. + (AC_ENABLE_STATIC): Ditto. And Ditto. + (AC_ENABLE_FAST_INSTALL): Ditto. And Ditto. + * ltdl.m4 (AC_LTDL_ENABLE_INSTALL): Use Autoconf-2.50 era + quadrigraphs and AC_HELP_STRING to bring AC_ARG_ENABLE + macro up to date. * NEWS: Updated. - * doc/libtool.texi (User defined module data): Updated. - * libltdl/ltdl.c (lt_dlhandle_next): New function. - * libltdl/ltdl.h (lt_dlhandle_next): Prototypes. - -2001-01-05 Gary V. Vaughan + * libtool.m4 [UnixWare7, OpenUNIX8]: Initial support for + UnixWare7 and OpenUNIX8. Accept these identifiers from the + latest config.guess/config.sub as pseudonyms for sysv5uw[78]. * NEWS: Updated. - * doc/libtool.texi (User defined module data): Document it all. - * ltdl.m4: Check for memcpy, or else bcopy. - * ltdl.c (lt_caller_data): New type. - (lt_dl_handle_struct): Add an lt_caller_data field. - (lt_dlcaller_register, lt_dlcaller_set_data, - lt_dlcaller_get_data): New functions. - (rpl_memcpy): A minimal fallback implementation. - (rpl_realloc): A realloc implemented with lt_dlmalloc and - lt_dlfree. - (LT_DLMALLOC, LT_DLFREE, LT_DLREALLOC, LT_DLMEM_REASSIGN): - New memory handling convenience macros. Use them - appropriately throughout the rest of this file. - * ltdl.h (lt_dlcaller_register, lt_dlcaller_set_data, - lt_dlcaller_get_data): Prototyped. - -2000-12-23 Gary V. Vaughan - - From vvv@vsu.ru: - * doc/fdl.texi (GNU Free Documentation License): contained @bye - command which prevented part of document to be generated (indices, - etc). - * doc/libtool.texi (Dlpreopening): the @deftypevar did not contain - a space after a type. - -2000-12-22 Akim Demaille + Reported by Boyd Lynn Gerber - * libtool.m4: s/[ \t]*$// +2001-07-29 Gary V. Vaughan -2000-12-22 Aneesh Kumar K.V + * tests/sh.test: Add a new test to enforce X as the fill + character in `test "X...'. + Beef up the `test' tests to also check `test -.' and `test ! -.' + phrases for compliance. + * ltmain.in: Fix quoting problems uncovered by the new tests. - * libtool.m4 (OSF/1): Revert my patch of 2000-12-16. +2001-07-29 Andrew C. Feren -2000-12-20 Gary V. Vaughan + * tests/sh.test: New test to disallow `test $foo', where + `test "$foo"' is much safer. + * ltmain.in: Fix quoting problems uncovered by the new test. - * libltdl/ltdl.c (lt_dlexit): Was checking for residency of the - wrong module. - Reported by Robert Boehne +2001-07-29 Steve Ellcey - * ltmain.in (dlprefiles): Now that `2000-12-15 Utz-Uwe Haus' patch - below can detect preopened library deplibs correctly in libltdl, - we need to ensure that libtool library deplibs are also preloaded - into the binary for that phase to work. + * libtool.m4 (lt_cv_sys_global_symbol_to_cdecl): Change it from + "extern char" to "extern int" so that GCC 3.0 won't complain and + refuse to compile programs containing "extern char main()". -2000-12-16 Aneesh Kumar K.V +2001-07-29 Gary V. Vaughan - * ltcf-c.sh (OSF/1): Change the way to pass linker flags through - compiler on a Tru64 machine. - * ltcf-cxx.sh (OSF/1): ditto. - -2000-12-16 Gary V. Vaughan - - * ltcf-c.sh (archive_cmds): And another one. Use test instead of - `['. - - * ltconfig.in (sys_lib_search_path_spec): Use test instead of - `['. - -2000-12-16 Wilfredo Sanchez - - * ltconfig.in: (dyld/darwin*) Much improved port. - * ltcf-c.sh: (dyld/darwin*) Much improved port. - * libtool.m4: (dyld/darwin*) Much improved port. - * ltmain.in: (dyld/darwin*) Much improved port. - -2000-12-16 Sascha Schumann - - * ltmain.in: Accept darwin as an alias for rhapsody. - - * libtool.m4 (AC_DEPLIBS_CHECK_METHOD): Use the HPUX 10.20 - methods to check for library dependencies on HPUX 11. - -2000-12-16 Gary V. Vaughan - - * ltconfig.in (deplibs_check_method, file_magic_cmd, - file_magic_test_file): Arghh! I keep forgetting that this stuff - has been moved... - * libtool.m4 (lt_cv_deplibs_check_method, lt_cv_file_magic_cmd, - lt_cv_file_magic_test_file): ...to here. Now fixed (again). - - * doc/libtool.texi (Libltdl interface): Add documentation. - * libltdl/ltdl.h (lt_dlmakeresident, lt_dlisresident): Add - prototypes. - (LT_DLERROR_CLOSE_RESIDENT_MODULE): New error status. - * libltdl/ltdl.c (lt_dlmakeresident, lt_dlisresident): Allow - making and testing of resident module status, which prevents a - module from being lt_dlclosed. - (lt_dlopen): If lt_dlopen()ing self, make the module resident. - (lt_dlclose): Return an error if the module is resident. - -2000-12-16 Nick Hudson - - * ltconfig.in (netbsd*, deplibs_check_method): Enable ILD support - for NetBSD a.out. - -2000-12-15 Akim Demaille - - * libtool.m4 (AC_PATH_TOOL_PREFIX): Similarly with - `ac_cv_path_MAGIC_CMD' - (AC_PROG_LD) : Likewise. - (AC_PROG_LD_GNU) : Likewise. - (AC_PROG_NM) : Likewise. - -2000-12-15 Utz-Uwe Haus - - * libltdl/ltdl.c (lt_dlopen): Changed "dl_dependency_libs" keyword - to "dependency_libs". - -2000-12-14 Tod Milam - - * libltdl/ltdl.c (lt_dlexit): Reset the loaders value to zero when - the last module has been unloaded. - -2000-12-14 Masahiro Nobori - - * README: Updated. + From Guido Draheim : + * libtool.m4 (AC_LIBTOOL_SYS_DYNAMIC_LINKER) [mingw]: Support + cross compilation to mingw by allowing `:' or ';' as a path + separator. * NEWS: Updated. - * libtool.m4: New port to NEWS-OS Release 6. - * ltcf-c.sh: ditto. - -2000-12-14 Nick Hudson - - * ltcf-c.sh (hardcode_libdir_flag_spec): Remove linker - sspecification for netbsd. - -2000-12-14 Akim Demaille - - * libtool.m4: Don't depend on Autoconf internals: - s/ac_cv_prog_gcc/GCC/. -2000-11-29 Gary V. Vaughan +2001-07-27 NIIBE Yutaka - * libltdl/ltdl.h (lt_dlhandle): Rename the wrapped structure - to prevent nameclash when used from C++. - * libltdl/ltdl.c: Fixed all references. + * libtool.m4 (lt_cv_deplibs_check_method): Use pass_all + for sh*-*-linux* (SuperH) too. -2000-11-25 Gary V. Vaughan +2001-07-25 Ossama Othman - * libltdl/ltdl.c (lt_dlopen): Change the default search order - for modules. If the named module has no directory component, - always start the search with the user_search_path directories, - and then fall back on the current directory only if that fails. + From Thomas Poindessous + * ltmain.in (pic_mode): Added missing quotes around shell + variable in "if test" conditional. -2000-11-20 Gary V. Vaughan + From Peter Moulder + * ltmain.in (xform): Add support for pre-processed + (e.g. `*.{i,ii}' sources). - * libltdl/Makefile.am (libltdl_la_LDFLAGS): increment the version - number to reflect the breakage of binary compatibility. - * doc/libtool.texi (Libltdl interface): Document - LT_NON_POSIX_NAMESPACE. - * libltdl/ltdl.h (LT_POSIX_NAMESPACE): Deleted. The default is - now to use this namespace, so the cpp macro is no longer - necessary. +2001-07-25 Gary V. Vaughan -2000-11-20 Morten Eriksen + From Steve Ellcey : + * libltdl/ltdl.c (foreach_dirinpath): Free unassigned pointer + fix for `canonical'. - * ltdl.m4 (AC_LIB_LTDL, AC_LTDL_SYMBOL_USCORE): Break a circular - dependency between AC_LTDL_SYMBOL_USCORE and AC_LTDL_DLSYM_USCORE. +2001-07-23 Robert Boehne -2000-11-20 Paul Berrevoets + * libtool.m4 (AC_LIBTOOL_LANG_CXX_CONFIG, AC_LIBTOOL_PROG_LD_SHLIBS) + [aix4*, aix5*]: Fixed a mispelled binder option under AIX. + The option to throw errors for unresolved external references is + -bernotok, not -bnoerok. - * ltmain.in: Some versions of expr respond with "0" if a - regexp fails to match. +2001-07-23 Gary V. Vaughan -2000-11-19 Gary V. Vaughan + * Makefile.am (EXTRA_DIST): Don't forget to distribute + ChangeLog.1. - * ltdl.c: Relegate non-POSIX-compliant symbols (e.g. those - ending in ``_t'') to deprecated #define compatibility macros. - Also ease up on the namespace pollution, so that only ``lt_'' - and ``LT_'' prefixes are taken from the global namespace. - * ltdl.h: ditto. + From Erik Lindahl + * libtool.m4 (_LT_AC_SYS_LIBPATH_AIX): Used on aix to discover + the compiler's default library search path so that the MPI + compiler suite is not hosed by the previously hardcoded path. + * libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS) [aix4*, aix5*]: Use it. -2000-11-17 Gary V. Vaughan +2001-07-23 Andreas Schwab - * ltdl.c: Reformatted. - * ltdl.h: ditto. + * libtool.m4 (AC_DEPLIBS_CHECK_METHOD): Use pass_all for + s390*-*-linux* and m68*-*-linux*. -2000-11-11 Gary V. Vaughan +2001-07-19 Robert Boehne - * ltdl.m4, ltcf-c.sh, libtool.m4: Use $ac_ext and $ac_objext - respectively for conftest sources and objects. - Reported by Carlo Wood + * libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS): Fix tag support + problems with CXX variables being overwritten by the individual + macros. + (AC_LIBTOOL_PROG_CC_C_O): Ditto. + (AC_LIBTOOL_PROG_COMPILER_PIC): Ditto. + (AC_LIBTOOL_LANG_CXX_CONFIG): Moved call to + AC_LIBTOOL_SYS_HARD_LINK_LOCKS after the call to + AC_LIBTOOL_PROG_CC_C_O as it depends on the result. + (AC_LIBTOOL_LANG_GCJ_CONFIG): Ditto. + (AC_LIBTOOL_LANG_C_CONFIG): Ditto. + (AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH): Used the macro + _LT_AC_TAGVAR to ensure the correct variable is being queried. + (AC_LIBTOOL_SYS_DYNAMIC_LINKER): Changed the naming of shared + objects under IRIX back to what it was in the MLB. - * doc/fdl.texi: New file. The license for distributing the - libtool manual. - * doc/libtool.texi: Reference the new license. +2001-07-23 Mark Kettenis -2000-10-31 Morten Eriksen + * libtool.m4 (AC_LIBTOOL_SYS_MAX_CMD_LEN) [gnu*]: Remove spurious + "break" and bogus comment + (_LT_AC_LANG_CXX_CONFIG): Add support for the Hurd. + * ltdl.m4 (AC_LTDL_SYS_DLOPEN_DEPLIBS): Add support for the Hurd. - * ltcf-c.sh, ltcf-gcj.sh: Quote argument to avoid error - output from cygpath when $srcdir is empty. +2001-07-16 Robert Boehne , Tim Mooney -2000-10-31 Akim Demaille + * ltdl.m4 (AC_LTDL_SYS_DLOPEN_DEPLIBS): add cases and comments for + more platforms, including AIX, Digital/Tru64 UNIX and IRIX. - * libtool.m4: Adjust the copyright notice. - Quote all the macro names when defined. - Some minor formatting changes. - (AM_PROG_LIBTOOL, AM_ENABLE_SHARED, AM_ENABLE_STATIC) - (AM_DISABLE_SHARED, AM_DISABLE_STATIC, AM_PROG_LD, AM_PROG_NM): - Don't use indir when useless. Don't add trailing `dnl' either. +2001-07-16 Gary V. Vaughan -2000-10-30 Gary V. Vaughan + * libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS): Fix ia64 AIX + run-time-linking when not using gcc. + (AC_LIBTOOL_LANG_CXX_CONFIG): Ditto. + Reported by Dan McNichol - * doc/libtool.texi: Corrected another attack of CRLF line - endings. +2001-07-12 Gary V. Vaughan -2000-10-30 Aneesh Kumar K.V - - * ltcf-c.sh (archive_expsym_cmds): Support for -export-symbol - option on Tru64. - -2000-10-30 Robert Boehne - - * ltcf-c.sh, ltcf-cxx.sh (hardcode_libdir_flag_spec, - allow_undefined, archive_cmds): Fix Compaq Tru 64 rpath and - "allow undefined" support. - -2000-10-27 Robert Boehne - - * docs/libtool.texi: Added pointers to documentation - of Hewlett-Packard, Compaq Tru64 and IBM AIX systems. - -2000-10-10 Alexandre Oliva - - * libtool.m4 (AC_LIBTOOL_CXX, AC_LIBTOOL_GCJ): Pass LD down to - ltconfig. - -2000-10-02 Gary V. Vaughan - - From Bruce Korb - * ltmain.in (execute_dlfiles): Reduce obfuscation. - -2000-09-30 Alexandre Oliva - - * ltconfig.in [netbsd*] (deplibs_check_method, file_magic_cmd, - file_magic_test_file): Removed inappropriate duplicate - definitions; these variables are set in AC_DEPLIBS_CHECK_METHOD. - - * libtool.m4 (lt_cv_file_magic_cmd): Don't use '${MAGIC_CMD}' or - '${OBJDUMP}'; Solaris' /bin/sh loses with `}' in cache files. - (ac_cv_path_MAGIC_CMD): Renamed to lt_cv_path_MAGIC_CMD. - -2000-09-28 Gary V. Vaughan - - * libtool.m4 (MAGIC_CMD): Don't use MAGIC, since BSD versions of - the file command use this environment variable to hold the - location of the magic database. - * ltconfig.in (MAGIC_CMD): ditto. - Reported by Marc Espie - -2000-09-20 Ossama Othman - - * ltconfig.in (lt_cv_dlopen_self, lt_cv_dlopen_self_static): Use - "$ac_ext" as test program extension instead of the hard-coded - "c" because the link command expects a test program ending with - the former. - Reported by Bob Friesenhahn - -2000-09-15 Nick Hudson - - * ltcf-cxx.sh (netbsd): Improved support. - * ltconfig.in (netbsd): ditto. - -2000-09-15 Gary V. Vaughan - - * ltmain.in (version_type): Use "-iface" as the windows - versioning scheme, where iface is the number of the oldest - interface supported. - -2000-09-14 Gary V. Vaughan - - From Paul Sokolovsky - * libtool.m4 (pw32): Initial support for pw32, assuming that - libtool's behaviour in this environment is identical to under - cygwin. - * ltconfig.in (pw32): ditto. - * ltmain.in (pw32): ditto. + From dda@sleepycat.com (Don Anderson): + * libtool.m4 (AC_LIBTOOL_SYS_DYNAMIC_LINKER) [qnx]: New + supported architecture. + (AC_DEPLIBS_CHECK_METHOD) [qnx]: Ditto. * NEWS: Updated. -2000-09-12 Michael Matz - - * ltmain.in: Be careful about filenames with multiple `.'s in - them when calculating file extensions. - Reported by Joel Reed - -2000-09-12 Alexandre Oliva - - * libtool.m4 (AC_PROG_LIBTOOL, AC_LIBTOOL_GCJ): Auto-detect - LT_AC_PROG_GCJ. - -2000-09-05 Alexandre Oliva - - * depdemo/main.c: Support -alt. - * tests/build-relink2.test: Try it. - - * ltconfig.in: Removed all references to what used to be - hardcode_into_libs=all. 2000-09-03's patch was wrong. - * ltmain.in: Likewise. - * tests/build-relink.test, tests/build-relink2.test: Adjust. - - * libtool.m4 (LT_AC_PROG_GCJ): Remove excess closing brackets. - -2000-09-04 Alexandre Oliva - - * mdemo/Makefile.am: Mark only libfoo2 as -no-undefined. - - * ltcf-c.sh (need_lc): Preserve allow_undefined_flag. - - * tests/*.test (CONFIG_SITE): Ultrix's /bin/sh fails on - `. /dev/null'. Set CONFIG_SITE to /dev/null/config/site, to make - sure we pick a non-existent file. - - * ltcf-c.sh, ltcf-gcj.sh (hardcode_libdir_flag_spec, - export_dynamic_flag_spec): Use ${wl}, not ${wlarc}. - - * ltmain.in (compile, need_lock): Don't create nor remove lock - files in dry runs. - - * libltdl/ltdl.c (load_deplibs): Don't append shlib_ext; use - lt_dlopenext() instead. - - * ltmain.in (link -static): Don't add $link_static_flag; only - -all-static should do that. - * mdemo/configure.in: Revert the previous delta. - - * mdemo/configure.in: Don't use -static on AIX4.1. - -2000-09-03 Alexandre Oliva - - * ltconfig.in: Get rid of hardcode_into_libs=all; use - hardcode_into_libs=yes && shlibpath_overrides_runpath!=yes - instead. - [FreeBSD 3.[01]] (shlibpath_overrides_runpath): Set to no. - * ltmain.in: Likewise. - * tests/build-relink.test, tests/build-relink2.test: Adjust. - - * libtool.m4: Fix typo I introduced in yesterday's patch. - - * libltdl/ltdl.c (lt_dlopen): Set dlname from library_names if - dlname is empty. - - * ltdl.m4 (HAVE_LIBDL): Look for dlopen in -lsvld. - * ltconfig.in: Likewise. - - * tests/mdemo-exec.test: Modify failure message. - - * ltmain.in (newdlprefiles): Use dlname if it's available and - old_library isn't; use linklib only if dlname is not available. - - * ltconfig.in (enable_dlopen): Set to no when lt_cv_dlopen is no. - - * libtool.m4 (AM_PROG_GCJ): Removed. - (LT_AC_PROG_GCJ): Use AC_CHECK_TOOL. Set GCJ to `no' if not - found. - * configure.in: Use LT_AC_PROG_GCJ. - Reported by Nick Hudson - - * tests/quote.test: Move the match test out of case statements, to - work around bug in /bin/sh of several OSs. - - * tests/defs (CC): Extract from the libtool script. - * tests/link.test, tests/link-2.test, tests/quote.test: Use it. - - * ltmain.in (variables_saved_for_relink): Attempt to unset them - instead of setting them to an empty string. - -2000-09-02 Alexandre Oliva - - * demo/Makefile.am: Don't extract configuration variables directly - from the libtool script, since it breaks with multiple - configurations. Use $(LIBTOOL) --config instead. - - * tests/link-2.test: Create hell.lo in the format expected by - libtool. - - * ltcf-c.sh, ltcf-cxx.sh, ltcf-gcj.sh (archive_cmds, - archive_expsym_cmds) : Use compiler_flags instead of linker flags - when $CC is used for linking. - Reported by Alex Hornby - -2000-09-02 Makoto Ishisone - - * libtool.m4 (lt_cv_deplibs_check_method, freebsd): Fix typo, - add support for compact format library. - -2000-09-02 Nick Hudson - - * configure.in: AC_SUBST reload_flag, deplibs_check_method - and file_magic_cmd. - -2000-09-02 Tom Kacvinsky , Tim Mooney - - * libtool.m4: Ignore Tru64's nm's complaint. - -2000-09-02 Pavel Roskin - - * ltconfig.in: only load $cache_file if it's a regular file - -2000-09-02 Assar Westerlund - - * ltconfig.in: Add back ranlib calls for static libraries if there - is a ranlib. - -2000-08-31 Gary V. Vaughan - - sh.test was failing unnecessarily. - - * ltmain.in: Xsed is overkill on $CC, and removing it prevents - the test suite from failing. - -2000-08-31 Ossama Othman - - * ltcf-c.sh, ltcf-cxx.sh, ltcf-gcj.sh: Removed RCD ID tags. They - were causing merge problems for those who maintain a copy of - libtool in their own CVS repository. - Reported by Bob Friesenhahn - -2000-08-27 Gary V. Vaughan - - * ltconfig.in (with_gcc): Make the value of this option - available to the generated libtool script. - * ltmain.in (compile_command, finalize_command): The native C - and C++ compilers on IRIX require the -LANG:std in order to to - compile correctly. The same options should _not_ be passed - through to gcc on IRIX, or at all on other architectures for - backwards compatibility (among others). - Reported by Bob Friesenhahn - Reported by Albert Chin-A-Young - -2000-08-26 Albert Chin-A-Young - - * ltcf-cxx.sh (old_archive_cmds): With IRIX C++ 7.3.1.1m, CC -ar - must be used to create archive libraries, not ar. - -2000-08-01 Alexandre Oliva - - * ltmain.in (shtool): Use echo|grep instead of expr, as in the - original patch. - -2000-08-01 Alexandre Oliva - - * ltcf-c.sh (need_lc): Fix test message. Set wl for archive_cmds. - (ac_cv_prog_cc_pic): Don't print `cached' without `checking'. - * ltcf-cxx.sh (need_lc): Set based on postdeps. - -2000-07-26 Alexandre Oliva - - * configure.in (AM_PROG_GCJ): Moved definition... - * libtool.m4: ... here. - - * ltmain.in (tagname): Use `case' instead of `grep' to infer it. - Match even when there are changes in white-space. - (link): Accumulate base_compile so that -L flags that are part of - $CC aren't retained. - -2000-07-24 Mocha - - * ltconfig.in (NetBSD, deplibs_check_method): Use file_magic. - (NetBSD, file_magic_cmd, file_magic_test_file): Set. - -2000-07-24 Michael Matz - - * ltcf-cxx.sh: Allow CC to have arguments. - -2000-07-24 Alexandre Oliva , David Kaelbling - - * ltmain.in (irix, major): Prepend a `.'. - * ltconfig.in (irix, soname_spec, library_names_spec): Adjust. - -2000-07-24 Alexandre Oliva , Ralf S. Engelschall - - * ltmain.in: Support GNU shtool's install. - -2000-07-24 Raja R Harinath - - * tests/Makefile.am (COMMON_TESTS): New variable. - (CXX_TESTS): Define unconditionally. - (TESTS): Move all tests to COMMON_TESTS, and conditionally - include CXX_TESTS. - (EXTRA_DIST): Don't use $(TESTS). - -2000-07-24 Alexandre Oliva - - * ltcf-c.sh (linkopts): Don't set for test. - * ltcf-cxx.sh (linkopts): Likewise. - -2000-07-24 Nick Hudson - - * ltcf-cxx.sh (linkopts): Replace with linker_flags. - - * ltmain.in (ILD): fix addition of deplibs in relink case. - -2000-07-19 H.J. Lu , Alexandre Oliva - - * ltcf-c.sh, ltcf-cxx.sh: Check if -lc is necessary for building - shared library. - * ltcf-gcj.sh: Assume -lc is implicitly linked in. - * ltconfig.in: Set build_libtool_need_lc to indicate it. - * ltmain.in: Add -lc when building shared library only if - necessary. - -2000-07-10 Mo DeJong - - * libtool.m4 (AC_PROG_NM): Fix macro so that it - finds a cross NM on the PATH. - -2000-07-10 Ken Block - - * libltdl/ltdl.h: Also check for __cplusplus, __STDC__ is not - by Compaq C++ compiler - -2000-07-10 Alexandre Oliva - - * ltcf-c.sh (wlarc, netbsd, aout): Set wlarc to empty. - (hardcode_dynamic_flag_spec, export_dynamic_flag_spec): Use - wlarc instead of wl. - * ltcf-gcj.sh (wlarc, netbsd, aout): Set wlarc to empty. - (hardcode_dynamic_flag_spec, export_dynamic_flag_spec): Use - wlarc instead of wl. - - * ltconfig.in (dynamic_linker, linux, powerpc): Do not disable - shared libraries just because of MkLinux. - -2000-07-10 Albert Chin-A-Young - - * ltcf-cxx.sh (archive_cmds, irix): Added -Wl to -update_registry - and its argument when gcc is the compiler. - -2000-07-10 Alexandre Oliva - - * libtool.m4 (lt_cv_deplibs_check_method, freebsd): Do not depend - on $version_type; check for ELF support as in other BSDs. - - * libtool.m4 (AC_LIBTOOL_GCJ): Require either AC_PROG_GCJ or - AM_PROG_GCJ. - (AC_PROG_LIBTOOL): Change internal comments to dnl, so that they - don't make it to the `configure' script. - - * configure.in (AM_PROG_GCJ): Re-enable, with definition copied - from CVS automake. - - * libtool.m4 (AM_PROG_GCJ): Quote it so that aclocal won't bring - it in if it only appears in libtool.m4. - (AC_PROG_LIBTOOL): Move AC_PROG_CXX, AC_PROG_GCJ and AM_PROG_GCJ - hooks here, so that they can be far simpler! - -2000-06-17 Syd Polk - - * libtool.m4 (AC_LIBTOOL_SETUP): Do not generate a libtool based - on target; use host instead. - * ltdl.m4 (AC_LTDL_SYSSEARCHPATH): Likewise. - -2000-06-10 Ossama Othman - - * 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 - - * 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 - * 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 - - * ltcf-cxx.sh (compiler_lib_search_path), ltconfig.in - (compiler_lib_search_path), ltmain.in (libs): The library path - that the compiler uses internally was being placed before the one - supplied by the user. Added a loop that moves that path after the - user supplied one. - Reported by Stephan Kulow and Michael Matz - - -2000-05-30 Gary V. Vaughan - - * ltconfig.in (ORIGINAL_CONFIG_SHELL): Prevent lossage when - the echo probing code falls into this branch without setting - this variable. - - * ltcf-c.sh (netbsd*): archive_cmds and archive_expsym_cmds - were reversed with respect to definition of __ELF__. - * ltcf-gcj.sh (netbsd*): ditto. - From Keisuke Inoue - -2000-05-29 Gary V. Vaughan - - * libtool.m4 (netbsd*): Use -L option to file_magic_cmd as for - freebsd (below). - * libtool.m4 (netbsd ELF): support file_magic. - From Dan Winship . - -2000-05-29 Steven M. Schultz + From Stefan Ondrejicka : + * libtool.m4 (AC_LIBTOOL_SYS_DYNAMIC_LINKER) [cygwin*]: Make + sure that /lib/w32api is searched for system libraries to + match recent versions of cygwin. + * NEWS: Updated. - * libtool.m4 (bsdi4*): Add -L option to bsdi4's file_magic_cmd - command. Under BSD/OS 4.1 several libraries are now symlinks - rather than regular files. Adding -L tells the file program - to follow the symlink. +2001-07-12 Dan McNichol -2000-05-29 Gary V. Vaughan + From albert chin + * libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS): Fix AIX + run-time-linking when using gcc. + (AC_LIBTOOL_LANG_CXX_CONFIG): Ditto. - * libtool.m4 (i*86-*-freebsd*): Forgot to changequote(,). +2001-07-11 Gary V. Vaughan - * NEWS: Updated. - * libtool.m4 (i*86-*-freebsd*): Support a.out shared libs. - From + * libtool.m4 (_LT_AC_LANG_CXX_CONFIG) [hpux, linux, osf, + solaris]: Doh! the evalled variable shouldn't have been + quoted. -2000-05-29 Fred Fish + * libtool.m4 (_LT_AC_LANG_CXX_CONFIG) [hpux, linux, osf, + solaris]: output_verbose_link_cmd have unquoted `*' in case + statements for these architectures. Be sure to quote them + with a sed expression before passing to eval. + Reported by Tim Mooney - Support AR=mwld AR_FLAGS='-xml -o' for PPC Beos. - * ltconfig (old_AR_FLAGS): Add. - (old_archive_cmds): Use AR_FLAGS rather than hardcoding "cru". - (archive_cmds): Use AR_FLAGS rather than hardcoding "cru". - (AR_FLAGS): Default to "cru" if not set. - * ltcf-c.sh: ditto. - * ltcf-gcj.sh: ditto. +2001-07-09 Gary V. Vaughan -2000-05-29 Gary V. Vaughan + * README-alpha: s/configure.in/configure.ac. + * configure.ac: Bumped version to 1.4c. - * ltconfig.in (echo): The following code actually prints the - double quotes -- so I removed them: - echo='printf "%s\n"' /bin/ksh -c '$echo \\t' - From Tuukka Toivonen + GNU libtool 1.4b was released. + * configure.ac: Bumped version to 1.4b. * NEWS: updated. + * config.guess, config.sub, texinfo.tex: Synchronised from + ftp.gnu.org. -2000-05-29 Bernhard Rosenkraenzer - - * libtool.m4: adding ia64 as supported linux platform - -2000-05-29 Michael Matz - - * ltmain.in: fix quoting for $var_value. +2001-07-09 Robert Boehne - * ltconfig.in: check for dlfcn.h: include return value - to make -Wall in CFLAGS work. + From Michael Elizabeth Chastain : + * libtool.m4 (AC_LIBTOOL_SYS_MAX_CMD_LEN): Set max_cmd_len + to a maximum of 512Kb, as it seems some HPUX 11.0 systems + have trouble with 1MB. -2000-05-27 Ossama Othman +2001-07-09 Gary V. Vaughan - * ltmain.in: Make sure $arg is set when linking `.lo' files into a - program. Moved tag decision code after check for recognized - source file extension (fixes "suffix" test failure). Merged - Rhapsody support from main trunk. - (output_obj) Added missing '$' before "echo" command (fixes "sh" - test failure). - * tests/suffix.test: Corrected typo in error message, and improved - the message. + * README-alpha: Upgrade distribution instructions to include + canonical location of texinfo.tex. -2000-05-27 Gary V. Vaughan +2001-07-09 Timothy Wall - * README-alpha: note new location of config.(guess|sub). + * libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS): Don't disable shlibs + on AIX5/IA64 with GNU ld. Keep gnu defaults if using gnu tools + on AIX5/IA64. -2000-05-26 Alexandre Oliva - - * THANKS: Added Art Pope. +2001-07-09 Robert Boehne -2000-05-26 Art Pope + * libtool.m4 (AC_LIBTOOL_SYS_MAX_CMD_LEN): Set max_cmd_len + to -1 on hurd, it has no command line argument limits. + * ltmain.in Handle max_cmd_len=-1 for systems that don't have + command line argument limits. - * ltcf-cxx.sh: Examine $CC when recognizing the C++ compiler - (it defaults to $CXX), and look at only its basename. - -2000-05-26 Alexandre Oliva - - * configure.in (GCJ): Check. - * Makefile.am (CFLAGS, CPPFLAGS, CXXFLAGS, LDFLAGS, LIBS): Let - automake define them implicitly. - (EXTRA_DIST, pkgdata_DATA): Added ltcf-gcj.sh. - (LIBTOOL_DEPS, LIBTOOL_CXX_DEPS, LIBTOOL_GCJ_DEPS): Define. - (libtool): Depend on LIBTOOL_DEPS. Add GCJ tag. - (libtool, clibtool): Pass host_triplet to ltconfig. +2001-07-05 Gary V. Vaughan - * libtool.m4 (_AC_PROG_LIBTOOL): Run before AC_LIBTOOL_GCJ. - Add ltcf-c.sh to LIBTOOL_DEPS. Run AC_LIBTOOL_CXX and - AC_LIBTOOL_GCJ on demand. - (AC_PROVIDE_IFELSE): Define for non-CVS autoconf compatibility. - (AC_LIBTOOL_CXX): Accept multiple executions. Add ltcf-cxx.sh - to LIBTOOL_DEPS. Reset config.log output. - (AC_LIBTOOL_GCJ): New macro. - * libtoolize.in: Copy ltcf-cxx.sh if AC_PROG_CXX is found. - Copy ltcf-gcj.sh when appropriate. - * doc/libtool.texi (AC_LIBTOOL_CXX): Doesn't have to be - explicitly called. - (AC_LIBTOOL_GCJ): Document. - * tagdemo/configure.in (AC_LIBTOOL_CXX): Don't call. - - * ltmain.in (xform): Recognize *.class and *.java. - (pic_flag): Do not add -DPIC. - * ltcf-c.sh (ac_cv_prog_cc_pic): Add -DPIC. - * ltcf-cxx.sh (ac_cv_prog_cc_pic): Add -DPIC. - * ltcf-gcj.sh: New file, mostly copied from ltcf-cxx.sh. - - * ltmain.in: Output libobj file in a temporary file, then - rename it. - - * ltconfig.in: Make the output script executable after updating - available_tags. - - * ltmain.in (compile): When output object is in subdir, create - the pic_object in subdir/objdir, not objdir/subdir. - -2000-05-24 Ossama Othman - - * libtool.m4 (AC_LIBTOOL_PICMODE): Merged this macro from the HEAD - branch. - (AC_LIBTOOL_CXX): Made sure CXX is exported to ltconfig. - * ltcf-cxx.sh (ac_ext): Changed test source extension to "cc" to - avoid potential ambiguities when using case-insensitive shells. - (archive_expsym_cmds): Make sure soname is set otherwise - -retain-symbol-file feature won't work. The change was made for - the Linux Compaq C++ and GNU G++ configurations. - Reported by Stephan Kulow . - * ltconfig.in, ltmain.in: Merged in changes from the HEAD branch. - * tests/Makefile.am (clean-local): Fixed typo where a "distclean" - was done in `mdemo' instead of the `tagdemo'. - -2000-05-14 Alexandre Oliva - - * configure.in (ACINCLUDE_M4_LIST): Removed libltdl/acinclude.m4. - * Makefile.am (aclocal_macros): Added ltdl.m4. - (libltdl/acinclude.m4): Concatenate libtool.m4 and ltdl.m4. - * bootstrap: Remove duplicate libltdl. - - * libtool.m4 (AC_LIBLTDL_CONVENIENCE, AC_LIBLTDL_INSTALLABLE): - Pick LIBLTLD from top_builddir and INCLTDL from top_srcdir. - * mdemo/configure.in: Remove comments on - AC_LIBLTLD_CONVENIENCE. - - * configure.in: Look for C++ compiler. - * Makefile.am (libtool): Configure CXX tag. - * tests/Makefile.am: Test tagdemo only if CXX found. - - * libtool.m4 (_AC_PROG_LIBTOOL): Renamed from... - (AC_PROG_LIBTOOL): Just AC_REQUIRE(_AC_PROG_LIBTOOL), to avoid - effects of multiple runs. - (_AC_PROG_LIBTOOL): Use AC_BEFORE to warn if called before - AC_LIBTOOL_CXX. - - * tagdemo/Makefile.am (lib_LTLIBRARIES): Moved libbaz.la from - noinst_LTLIBRARIES. - - * configure.in: Bump version number to 1.4a, since this will - eventually become libtool 1.5. - -2000-02-28 Ossama Othman - - * ltmain.in (libobjs, reload_conv_objs): When searching for object - files, search for "*.$objext," not "*.o." - (compile_command, finalize_command, progfiles): No need to - transform `.lo' objects into standard `.o' objects. `.lo' files - are converted to the appropriate `.o' file earlier in the link - mode code. - * doc/libtool.texi (AC_LIBTOOL_CXX): Documented this - macro, and the `tagdemo' test that utilizes it. Updated C++ and - tagged configuration documentation. - -2000-02-25 Ossama Othman - - * libtool.m4, ltconfig.in: Merged in changes from most recent HEAD - branch version. - * ltmain.in: Merged in changes from most recent HEAD branch - version (ILD updates), and fixed parallel build error. - * tagdemo/acinclude.m4, tagdemo/aclocal.m4, tagdemo/configure: - regenerated these files against updated libtool.m4. - -2000-02-22 Ossama Othman - - * libtool.m4 (AC_LIBTOOL_CXX): Added missing "$lt_target" command - line argument in call to `ltconfig'. This fixes a problem that - was occuring when a host type was specified by the user. Also - added missing "$reload_flag" environment. - -2000-02-17 Ossama Othman - - * libtoolize.in (files): Add C++ support if configure.in uses - AC_LIBTOOL_CXX, i.e. add `ltcf-cxx.sh' to list of files to be - copied during libtoolization. - * ltdl.m4: Added this file to the multi-language branch. - -2000-02-08 Ossama Othman - - * ltcf-cxx.sh (predeps, postdeps, predep_objects, - postdep_objects): Split {pre,post}deps into a variable that hold - library dependencies and another that holds objects needed during - shared library generation. This was needed so that the objects - needed for shared library generation do not get analyzed by the - ILD mechanism. The objects are only used during the initial - creation of the shared library, not during subsequent links to - that library. - (archive_cmds, archive_expsym_cmds): Added $predep_objects before - all objects and libraries, and $postdep_objects after them. This - is necessary when linking C++ shared libraries. - (output_verbose_link_cmds): Added shared library generation - compiler flag. The objects and libraries the compiler links when - creating shared libraries may be different than those used when - linking programs, particulary for object files. - * ltconfig.in (predep_objects, postdep_objects): Include these - variables in the generated libtool script. - * ltmain.in: Quote regular expression used for automatic tagged - configuration selection. Also improved the regular expression - used for matching. - Updated clean mode to work properly with the new `.lo' files. - (libs): Only add $predeps and $postdeps to the list of dependency - libraries when linking a library. - * tagdemo/Makefile.am (noinst_LTLIBRARIES): Added another test - library that depends on the existing test library. It was added - to exercise the ILD mechanism when using tagged configurations. - (tagdemo_LDADD): The tagdemo program now depends on the new test - library. Since the new test library depends on the previous one, - the previous library should be linked to the program as well. - * Makefile.in: Regenerated from updated Makefile.am. - * tagdemo/baz.cpp, tagdemo/baz.h: Added these sources. They are - new test library sources. - * tagdemo/main.cpp (main): Added call to method in new test - library. - -2000-02-05 Ossama Othman - - * ltmain.in: The "-R*" case in the loop that iterates through - library dependencies doesn't handle the case of the "lib" link - mode. As such, the next iteration should immediately follow. The - "continue" inside the "if" block has been moved outside that - block. Previously, the "-R*" case would just "fall through" when - in "lib" link mode, but $lib="" which caused a "library not found" - error later on. - Reported by Stephan Kulow - -2000-02-05 Ossama Othman - - * bootstrap: Merged updates from HEAD branch. - (sub): Added tagdemo to list of subdirectories to be - bootstrapped. - * ltcf-cxx.sh (AR): Removed redefinition of $AR to C++ compiler on - Solaris for the Sun C++ and Green Hills C++ compilers. `ar' must - be used to extract object files from the archives, despite the - fact that the archive must be created by the compiler. - Reported by Stephan Kulow - (predeps, postdeps): Remove any space between "-{L,R}" and the - path. Some compilers, such as HP aCC add space between them. - * ltconfig.in (dlopen, dlopen_support): Merged updates from HEAD - branch. - * ltmain.in: Merged updates from HEAD branch. - (libext): Do not reset $libext to `al' when creating convenience - libraries. Some compilers have problems with such a non-standard - extension. - Reported by Stephan Kulow - * doc/libtool.texi: Merged updates from HEAD branch. - * libltdl/Makefile.am, libltdl/configure.in, libltdl/ltdl.c, - libltdl/ltdl.h: Merged updates from HEAD branch. - -2000-02-03 Ossama Othman - - * ltconfig.in (available_tags): The name of each newly added - tagged configuration is appended to this list. This is done at - ltconfig time so that the generated `libtool' script need not - determine which tags it supports everytime it is used. The - available_tags variable is used by `ltmain.in' to iterate over - each of the tagged configurations when attempting to automatically - choose which one to use for the supplied compile/link command. - * ltmain.in: Added ability to automatically determine which tagged - configuration to use based on the compiler found in the supplied - base compile command. - (available_tags): This new variable contains a list of available - tagged configurations. This gets generated at ltconfig time. - (object_name, old_object): Renamed these to pic_object and - non_pic_object, respectively. - * doc/libtool.texi (Configuration tags): Updated documentation. - Libtool now has the ability to infer which tagged configuration to - use based on the compiler found in the supplied base compile - command. - * tagdemo/configure.in, tagdemo/configure: Removed explicit - substitution of "--tag=CXX" in $LIBTOOL. The newly added - automatic selection of tagged configurations obviates the need to - explicitly specify which tag to use. - -2000-02-01 Ossama Othman - - * ltcf-cxx.sh: Added some untested HPUX aCC support. - * ltmain.in: Inadvertently removed some of the tags patch. - * tagdemo/Makefile.am, tagdemo/Makefile.in, tagdemo/README, - tagdemo/acinclude.m4, tagdemo/aclocal.m4, tagdemo/configure, - tagdemo/configure.in, tagdemo/foo.cpp, tagdemo/foo.h, - tagdemo/main.cpp: *sigh* I checked this directory into the HEAD - branch instead of the multi-language-branch. - Reported by Stephan Kulow - -2000-01-31 Ossama Othman - - * configure.in (CONF_SUBDIRS): Added the `tagdemo' directory to - the list. - * ltcf-cxx.sh: Remove any residual `a.out' files resulting from - the "eval $output_verbose_link_cmds." - * ltconfig.in: Cleaned up nested quotes that were introduced with - the tags patch. This fixes part sh.test failure. - * ltmain.in: Check if "$run" is of zero length before creating a - `.lo' file. This fixes the dryrun.test failure. - Cleaned up nested quotes that were introduced with - the tags patch. This fixes another part sh.test failure. - Remove "$libobj" not "libobj." - Exit with an error if both $object_name and $old_object are set to - "none" in the corresponding `.lo' file. This should never happen. - Changed remaining uses of "mkdir" to "$mkdir." - Added dry run case to `.lo' case in link mode. This fixes the - link-2.test failure. - (object_name, old_object): Prepend the subdirectory the `.lo' - resides in to the object names extracted from the `.lo' file. - This fixes the build-relink2.test failure. - (tempemovelist): Use $echo "X..." instead of echo "..." since - $Xsed is being used. This fixes the last part of the sh.test - failure. - * tagdemo/Makefile.am, tagdemo/Makefile.in, tagdemo/README, - tagdemo/acinclude.m4, tagdemo/aclocal.m4, tagdemo/configure, - tagdemo/configure.in, tagdemo/foo.cpp, tagdemo/foo.h, - tagdemo/main.cpp, tests/tagdemo-conf.test tests/tagdemo-exec.test - tests/tagdemo-make.test tests/tagdemo-shared.test - tests/tagdemo-static.test: Added a new tagdemo that exercises - libtool's tagged configuration support found in the multilanguage - branch. - * tests/Makefile.am (TESTS): Added the tagdemo tests to the list. - * tests/quote.test: Updated to HEAD branch version. This fixes - the quote.test failure. - -2000-01-31 Ossama Othman - - * ltconfig.in (compile_c_lo): Removed the test that checks if - compiler support "-c -o file.lo" since the changes made to - ltmain.in remove the need to do this. - * ltmain.in: Changed compile mode to generate `.lo' libtool - objects, instead of generating PIC objects that end in `.lo'. - These are analogous to libtool archive `.la' files. They contain - the name of the PIC and non-PIC objects. All PIC objects will now - be placed in `$objdir' (usually `.libs'). No changes to existing - Makefiles should be necessary. Libtool should work the same as it - did prior to this change. This change was necessary to correct a - problem with Sun C++'s template repository mechanism since it - couldn't handle repository objects ending in `.lo'. This change - causes some tests to fail, so it still needs some work. The tests - that fail are: dryrun.test, build-relink2.test, link-2.test. The - quote.test and sh.test tests also fail but they failed after the - initial multi-language changes were made. - -2000-01-25 Ossama Othman - - * libtool.m4, ltconfig.in, ltmain.in: Merged updates found in - HEAD branch. - - * ltcf-c.sh: Merged updates related to PIC flags and link - characteristics from HEAD branch ltconfig.in. - -2000-01-22 Ossama Othman - - * libtool.m4 (AC_LIBTOOL_CXX): Added LDFLAGS to list of variables to - pass to ltconfig when creating C++ compiler tag. - - * ltcf-cxx.sh: Added support for the DEC/Compaq C++ compiler on - Linux and osf[3,4,5]. - - (whole_archive_flag_spec): Corrected commands that check if GNU - linker supports "--whole-archive" flag. GNU C++'s - "-print-prog-name" flag is used to determine what the linker is - instead of using the 'LD' variable. - - (ac_cv_prog_cc_wl): Corrected value for Sun C++. Previously it - was set to '-Wl,' when it should have been '-Qoption ld '. - - * ltconfig.in (ac_cv_prog_cc_pic_works, - ac_cv_prog_cc_static_works): Make sure variable is not an empty - string, even if it is set. - -1999-12-06 Ossama Othman - - * ltcf-c.sh: split off the osf3 section, so that the osf4 and osf5 - sections can add `-msym' to arguments passed to the linker for - shared libs. - Reported by Tim Mooney - -1999-12-05 Ossama Othman - - * libtool.m4 (AC_LIBTOOL_SETUP): Temporarily reset the test - language to C just before calling AC_OBJEXT and AC_EXEEXT and then - restore the previous one when done, instead of doing an - AC_BEFORE(...AC_LANG_CPLUSPLUS...). A warning would always occur - anyway because AC_PROG_CXX calls AC_LANG_CPLUSPLUS. - -1999-12-05 Ossama Othman - - * libtool.m4 (AC_LIBTOOL_SETUP): Make sure AC_LIBTOOL_SETUP is - called before any macros that set the autoconf test language - (e.g. AC_LANG_CPLUSPLUS). Autoconf's AC_EXEEXT macro only works - for C compilers. AC_EXEEXT gets confused and thinks that an - extension such as the C++ source file extenstion ".C" is an - executable file extension, which screws up the libtool - configuration. - - Pass the same autoconf variables used in the main ltconfig run to - the ltconfig configuration tag run (with the exception of a few). - This probably isn't necessary but I think it is a good idea to do - so. - - * ltconfig.in: The tagged configuration was being cached and - overwriting the C compiler cached configuration. For now, - the tagged configuration will not be cached. - -1999-12-04 Ossama Othman - - * ltconfig.in: Made "appending to libtool" message more - descriptive. - -1999-12-04 Ossama Othman - - With this latest set of updates I was able to build a C++ shared - library using a C++ configuration tag for g++ on Linux! Some may - think that this isn't much of an accomplishment but static - constructors appear to work now, whereas prior to the addition of - the multi-language support patches they didn't. - - * libtool.m4 (AC_LIBTOOL_CXX): Made invocation of ltconfig more - like the one in AC_PROG_LIBTOOL. This adds some ILD related flags - to the invocation, in addition to providing the $libtool_flags to - ltconfig that was previously in AC_PROG_LIBTOOL (via - AC_LIBTOOL_SETUP). This fixes an ILD related bug with the C++ - support, and also fixes a problem where both the static and shared - libraries were being built even if one of them was explicitly + * libtool.m4 (_LT_AC_LANG_C_CONFIG): Revert to 1.3.x + sematics, and always build static libs when the host machine + cannot build shared libs. Even if static libs were explicitly disabled. - * ltcf-cxx.sh: Make sure $ac_cv_prog_cc_pic_works and - $ac_cv_prog_cc_static_works are unset since their C compiler - cached values will override their C++ compiler specific values. - Note that it was not enough to reset their values. They had to be - unset. - -1999-12-04 Ossama Othman - - * doc/libtool.texi: Moved "LTCC" in "--add-tag" example before - "CC" because users may inadvertently do something like the - following: - - CC=$CXX LTCC=$CC ./ltconfig --add-tag=... - - Doing the above would set LTCC to the C++ compiler ($CXX), which - is incorrect since LTCC should be the C compiler. Also added - documentation explaining this potential problem. - - * Makefile.am (EXTRA_DIST): Added ltcf-c.sh, ltcf-cxx.sh and - ChangeLog.1 to list of files to include in the distribution. - (pkgdata_DATA): Added ltcf-sh.sh and ltcf-cxx.sh to the list of - data files. - - * libtool.m4 (AC_LIBTOOL_CPP): Change name of macro that enables - C++ support in libtool from "AC_LIBTOOL_CPP" to "AC_LIBTOOL_CXX." - "CPP" is typically associated with preprocessors, whereas CXX is - associated with C++ compilers. - - Moved LTCC before CC in call to ltconfig to make sure LTCC is not - set to the compiler pointed to by CC after CC has been reset to - another compiler. - - Call ltconfig with ${CONFIG_SHELL-/bin/sh} just like we do in - AC_PROG_LIBTOOL. - - Save value of $CC and $CFLAGS before resetting them for use with - configuration tags. - - * libtoolize.in (files): Added ltcf-c.sh to list of files related - to "libtoolization." Until we decide if other compiler/language - libtool configuation scripts should also be included in the file - list, leave out ltcf-cxx.sh for now. - - * ltcf-cxx.sh (ld_shlibs): Disable shared library support for - currently unconfigured platforms. Updated IRIX, Linux and Solaris - link characteristics. They now match more with their C compiler - counterparts. - - * ltconfig.in: Corrected tag name variable in "END LIBTOOL TAG - CONFIG: $tagname" text. - -1999-12-03 Ossama Othman - - * Makefile.am, libtool.m4, ltconfig.in, ltmain.in, - doc/libtool.texi, tests/defs: The beginnings of - multi-compiler/language support in libtool. - - Integrated Alexandre's configuration tags patch, part of Thomas' - patch and part of my patch. +2001-07-02 Gary V. Vaughan + + Cleanup of libltdl: + * ltdl.c (lt_dladderror): Don't use `index' as a variable name, + since it is a function on BSD based boxes. + (lt_dlseterror): Ditto. + (lt_dlexit): Remove unused errormsg declaration. + (foreach_dirinpath): Make sure filename is initialised. + (find_handle): Return NULL for a failed search. + (foreachfile_callback): Don't reuse data2 symbol from prototype + in func declaration to prevent symbol shadowing. + * ltdl.h (lt_dlmutex_seterror): Don't use `error' as a parameter + name, since it is a function on glibc boxes. + + * libtoolize.in: Display --version in the same format as + autoconf and automake. + * ltmain.in: Ditto. + +2001-06-30 Gary V. Vaughan + + Merge test improvements from multi-language-branch: + * tests/defs: Find and set the value of CC probed by libtool.m4 + * tests/link-2.test: Use a .lo wrapper script, and the value of + CC set by defs instead of hardcoding gcc. + * tests/link.test: Use the value of CC set by defs instead of + hardcoding gcc. + * tests/quote.test: Ditto. + * tests/suffix.test: Ditto. + + * libtool.m4 (AC_LIBTOOL_PROG_COMPILER_PIC) [aix*]: Always set + lt_prog_compiler_wl to `-Wl'. + Reported by Albert Chin-A-Young + + * ltdl.m4 (AC_LTDL_DLLIB) [sco3.2*]: When searching for a dlopen + implementation, and adding `-ldl' has failed, try linking a call + to dlopen, #including dlfcn.h, and without -ldl. On sco3.2 the + header files redefines the interface symbols to point at the + implementation symbols in libc. + Reported by "Golubev I. N." + +2001-06-29 Tim Van Holder + + General cleanup of autoconf-2.50 upgrade: + * configure.ac: Mark as needing autoconf-mode in + emacs. Pass arguments to AC_INIT. + * cdemo/configure.ac: Ditto. + * demo/configure.ac: Ditto. + * depdemo/configure.ac: Ditto. + * libtldl/configure.ac: Ditto. + * mdemo/configure.ac: Ditto. + * pdemo/configure.ac: Ditto. + * tagdemo/configure.ac: Ditto. + * ltdl.m4: Mark as needing autoconf-mode in + emacs. + * libtool.m4: Mark as needing autoconf-mode in + emacs. Don't add () to AS_MESSAGE_LOG_FD. + * libltdl/configure.ac: Use config-h.in as + template for config.h. + * tagdemo/configure.ac: Drop the AC_DIAGNOSTIC. Move + AC_LANG([C++]) after the OBJEXT/EXEEXT check. + +2001-06-29 Gary V. Vaughan + + From Tim Van Holder + * tests/suffix.test: Typo in 2nd for loop. + + From Tim Van Holder + * libltdl/Makefile.am (OBJECTS): This was an implicit variable. + instead state the list of object variables explicitly. + + From Bruno Haible + * libtool.m4: undefine the m4 builtin `symbols', so that the + string `symbols' can be used in the rest of the code without + causing errors with autoconf-2.13. + + From "Golubev I. N." + * tests/Makefile.am (CPPLAGS): Typo. s/CPPLAGS/CPPFLAGS. + + * mdemo/Makefile,am (foo1_la_LIBADD): Add libsub.la, since foo1 + does use symbols from libsub.la -- only platforms that allow + undefined symbols in libraries were able to cope with this + previously. + Reported by Robert Collins + + From "Golubev I. N." + * libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS) [sco3.2v5*]: Needs + -wl,-Bexport to make self dlopen work. + +2001-06-28 Gary V. Vaughan + + From Alexander Bluhm + * libltdl/ltdl.c (lt_dlopen): Fix bad memory initialisation + assumptions. + + * libtool.m4 (AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE) [HPUX]: Define + lt_cv_sys_global_symbol_to_c_name_address to be a sed expression + for mangling the output of the symbol pipe into a brace delimited + C declaration of symbol name and address. + * ltmain.in: Use it to generate the fooS.c symbol name + Reported by Albert Chin-A-Young + +2001-06-28 Tim Van Holder , Gary V. Vaughan + + * bootstrap: Use cp instead of ln -s, for systems without + symlinks. Reorder the statements to avoid repetition outside + the loop. + +2001-06-28 Paolo Bonzini , Gary V. Vaughan + + Libtool now builds with the help of Autoconf-2.50! + * configure.ac (AC_PREREQ): Require Autoconf-2.50 or newer. + (AC_PROG_CPP, AC_EXEEXT, AC_OBJEXT): Removed. Autoconf-2.50 + doesn't have the AC_REQUIRE bug that required these to be called + explicitly from here. Autoconf-2.50 uses this file instead of... + * configure.in: ...this, which is now deleted. + * cdemo/configure.ac, cdemo/configure.in: Ditto. + * demo/configure.ac, demo/configure.in: Ditto. + * depdemo/configure.ac, depdemo/configure.in: Ditto. + * libltdl/configure.ac, libltdl/configure.in: Ditto. + * mdemo/configure.ac, mdemo/configure.in: Ditto. + * pdemo/configure.ac, pdemo/configure.in: Ditto. + * tagdemo/configure.ac, tagdemo/configure.in: Ditto. + * libltdl/acconfig.h: Deleted. + * Makefile.am (libtool): libtool now depends on configure.ac. + * libtool.m4 (_LT_AC_LOCK): Use 2.50's AC_LANG_PUSH/AC_LANG_POP + instead of 2.13's AC_LANG_SAVE/AC_LANG_RESTORE. + (AC_LIBTOOL_LANG_C_CONFIG): Ditto. + (AC_LIBTOOL_LANG_CXX_CONFIG): Ditto. + * libtoolize.in: Use $configure_ac, instead of hardcoding + configure.in. - These patches make it possible for libtool to support - compilers besides C compilers. This also includes support for - linkers besides `ld', and similarly for other tools commonly used - for development. See the libtool documentation for more details. +2001-06-28 Tim Van Holder - Moved all C compiler related configuration code to `ltcf-c.sh', - described below. + * pdemo/Makefile.am: Use '=' instead of '+=' to shut up + automake. - Multi-compiler/language still isn't complete but testing is now - possible. +2001-06-27 Gary V. Vaughan - * ltcf-c.sh: Added this file. It contains all of the C compiler - related configuration code that was previously in ltconfig.in. - This script is meant to be sourced by the ltconfig script alone. - It is not meant for use by the user. Eventually, the contents of - this file will be moved to `libtool.m4'. + From brad@openbsd.org: + * NEWS: Updated. + * libtool.m4 (AC_LIBTOOL_SYS_DYNAMIC_LINKER) [openbsd]: Improved + support for various openbsd platforms. + (AC_LIBTOOL_PROG_LD_SHLIBS): Ditto. + * ltmain.in: Ditto, - * ltcf-cxx.sh: Added this file. It contains C++ compiler related - configuration code (e.g. C++ compiler as linker, etc). It is - meant to be used when creating configuration tags using the - newly added "--add-tag" ltconfig option. See the libtool - documentation for more details. Eventually, the contents of this - file will be moved to `libtool.m4'. +2001-06-26 Gary V. Vaughan - This script also includes support for extracting the objects and - libraries the compiler would use when linking a C++ binary. This - support should allow static constructors and the like to work - properly. + * NEWS: Updated. + * libltdl/ltdl,c (LT_DLMUTEX_LOCK): Renamed from MUTEX_LOCK to + avoid potential namespace clash. + (LT_DLMUTEX_UNLOCK, LT_DLMUTEX_SETERROR, LT_DLMUTEX_GETERROR): + Ditto. + (lt_dlmutex_lock_func): Renamed from mutex_lock to avoid a + namespace clash of NCR MP-RAS. + (lt_dlmutex_unlock_func, lt_dlmutex_seterror_func, + lt_dlmutex_geterror_func): Ditto. + Reported by Edouard G. Parmelan + + * libltdl/ltdl.c (LT_DLSTRLEN): Call strlen only if the argument + is non-NULL and non-zero in length. Changed all calls to strlen + appropriately. + + * libltdl/ltdl.c: Prototype all static functions. + + * ltdl.m4: Bump serial number to 3. + (AC_LIB_LTDL): Require AC_HEADER_DIRENT for ltdl.c. + * libltdl/ltdl.h (lt_dlforeachfile): Prototype for new function. + * libltdl/ltdl.c: Include an appropriate header for the + opendir/dirent api. + (foreach_dirinpath): Visit each file in a list of directories. + (find_file_callback): Factor out the core of find_file() to make + use of foreach_dirinpath(). + (find_file): Use it! + (find_handle_callback, find_handle): Ditto. + (lt_dlforeachfile): New function to find files in a searchpath.,, + (foreachfile_callback): ...using this callback. + * doc/libtool.texi (Libltdl interface): Document new + lt_dlforeachfile api call. + +2001-06-25 Gary V. Vaughan + + * THANKS: Added Albert Chin-A-Young. + + * libtool.m4 (IFS): When IFS is changed to split a string for + examination in a loop, restore it inside the loop as well as + outside incase IFS is needed by commands in that loop. + Reported by Pavel Roskin + +2001-06-25 Albert Chin-A-Young + + * libtool.m4: Prefer shl_load to dlopen on HP-UX because dlopen + won't work properly without a patch. + +2001-06-25 Daniel Harvey + + * libtool.m4 (ltdll_cmds): [$]0 doesn't appear to translate through + the script correctly, change to $''0 + +2001-06-25 Maciej W. Rozycki + + * libtool.m4 (AC_DEPLIBS_CHECK_METHOD): Use pass_all for + mips-*-linux* and mipsel-*-linux*. + +2001-06-24 Andreas Schwab + + * libtool.m4 (AC_LIBTOOL_SETUP): Remove failed try to + transform linux to linux-gnu in $host. + (AC_LIBTOOL_SYS_DYNAMIC_LINKER): Match $host_os against + linux*, not linux-gnu*. + (AC_DEPLIBS_CHECK_METHOD): Likewise. + +2001-06-24 Gary V. Vaughan + + * libtool.m4 (_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR): Set + PATH_SEPARATOR appropriately if it is not set already, + (_LT_AC_TAGCONFIG): Use it. + (AC_ENABLE_SHARED): Ditto. + (AC_ENABLE_STATIC): Ditto. + (AC_ENABLE_FAST_INSTALL): Ditto. + (AC_PATH_TOOL_PREFIX): Ditto. + (AC_PATH_MAGIC): Ditto. + (AC_PATH_PROG_NM): Ditto. + + From Tim Van Holder : + * libtool.m4: Use the canonical absolute path test + ([\\/]* | ?:[\\/]) and $PATH_SEPARATOR wherever + appropriate. + (AC_LIBTOOL_PROG_CC_PIC): Properly recognize DJGPP as a + platform that doesn't support shared libraries. + (AC_LIBTOOL_SYS_MAX_CMD_LEN): Avoid this test on DJGPP; use a + fixed value (12K) instead. + (AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE): Don't forget $ac_exeext + when testing for link success. + + * configure.in (AM_INIT_AUTOMAKE): Bumped version to 1.4a. + + Complete the new configure time tags creation facility based on + the ltcf-*.sh and ltconfig.in files from multi-language-branch: + * libtool.m4: More refactoring and reformatting. + (_LT_AC_LANG_GCJ_CONFIG): Merged ltcf-gcj.sh from + multi-language-branch. + (_LT_AC_LANG_CXX_CONFIG): Merged ltcf-cxx.sh from + multi-language-branch. + * configure.in (AC_PROG_CXX, LT_AC_PROG_GCJ): Compiler checks must + be done before AC_PROG_LIBTOOL which appends tags based on their + results. + +2001-06-12 Robert Boehne + + * docs/libtool.texi: Updated the libltdl interface documentation + to bring it up to date. + +2001-06-06 Gary V. Vaughan + + * demo/Makefile.am (objdir): Use `libtool --config' for + extracting configuration values, since a given value may + be present in each tag. + (hc-libpath): Ditto. + (hc-minusL): Ditto. + * libtool.m4 (_LT_AC_TAGCONFIG): Add tagged configurations from + the --with-tags option. + (_LT_AC_LTCONFIG_HACK): Factored out into separate configuration + macros -- The interdependencies and running order are still + immutable, and need a lot of work to fix. + (AC_LIBTOOL_CONFIG): Taken from the previous incarnation of + _LT_AC_LTCONFIG_HACK -- this macro is used both to create the + primary (C language) libtool configuration from + _LT_AC_LTCONFIG_HACK and also to append tagged configurations from + _LT_AC_TAGCONFIG. + * NEWS: Merged from multi-language-branch. + +2001-06-06 Robert Boehne + + * bootstrap: Added tagdemo and pdemo tests from + multi-language-branch. + * configure.in: Added pdemo and tagdemo to CONF_SUBDIRS + and merged references to CXX and GCJ from multi-language-branch. + * pdemo: Added test directory from multi-language-branch. + * tagdemo: Added test directory from multi-language-branch. + * tests/Makefile.am: Merged additional tests from + multi-language-branch. + * tests/pdemo-*.test: ditto. + * tests/tagdemo-*.test: ditto. + +2001-05-30 Gary V. Vaughan + + * libtool.m4: Merged ltconfig.in from multi-language-branch. + +2001-05-28 Gary V. Vaughan + + * libtool.m4: Reformatting for consistency, and some refactoring + in preparation for ltcf-*.sh merge. + +2001-05-27 Gary V. Vaughan + + * ltmain.in: Merged from multi-language-branch. + * libtool.m4: Merged from multi-language-branch. + * ChangeLog: Started afresh. Old ChangeLog history moved to... + * ChangeLog.1: ...here. Continued in ChangeLog.1 diff --git a/ChangeLog.0 b/ChangeLog.0 index 2424f8965..ff0019755 100644 --- a/ChangeLog.0 +++ b/ChangeLog.0 @@ -273,7 +273,7 @@ * mdemo/configure.in: use AC_LIBLTDL_CONVENIENCE * mdemo/Makefile.am: refer to @LIBLTDL@ -1999-03-09 Gary V. Vaughan +1999-03-09 Gary V. Vaughan * NEWS: updated. @@ -396,7 +396,7 @@ only on FreeBSD and when not static linking; it's been causing trouble on platforms such as OpenBSD. -1999-02-26 Gary V. Vaughan +1999-02-26 Gary V. Vaughan * libtool.m4 (cygwin): s/\\(mingw\\|cygwin\\)32/\\1/g. Must've missed this file when I changed to cygnus' new sanction name. @@ -514,7 +514,7 @@ * libltdl/ltdl.c (lt_dlopen): use newhandle instead of handle where appropriate, when dlopening a non-libtool library -1999-02-19 Gary V. Vaughan +1999-02-19 Gary V. Vaughan * ltconfig.in (export_symbols_cmds): renamed from export_symbols_cmd. @@ -545,7 +545,7 @@ alternate name without ${release}, otherwise build fails when -release is used -1999-02-18 Gary V. Vaughan +1999-02-18 Gary V. Vaughan * ltconfig.in (archive{,_sym}_commands): Be careful not to re-export the dll entry points DllMain@12, _cygwin_dll_entry@12 and @@ -610,7 +610,7 @@ * mdemo/configure.in: use AC_LIBTOOL_DLOPEN * mdemo/main.c: demonstrate lt_dlopen(0) -1999-02-15 Gary V. Vaughan +1999-02-15 Gary V. Vaughan * demo/dlmain.c (_WIN32): The lt_symlist structure is now const, so my original horrible temporary win32 hack no longer worked. @@ -648,7 +648,7 @@ * ltmain.in: allow -export-symbols for modules, use thread_safe flag, add include_expsyms to the exported symbols -1999-02-12 Gary V. Vaughan +1999-02-12 Gary V. Vaughan * libltdl/ltdl.h (_LTDLL_EXTERN): libltdl is no longer linked as a shared library, so the _declspec's were preventing the linker from @@ -740,7 +740,7 @@ * libltdl/ltdl.c (lt_dlopenext): tmp would be trashed if shlib_ext was longer than 3 characters -1999-02-02 Gary V. Vaughan +1999-02-02 Gary V. Vaughan * ltconfig.in: new config.guess returns *-*-cygwin now instead of *-*-cygwin32. sed -e 's%\(cygwin\|mingw\)32%\1%g' ltconfig.in @@ -752,7 +752,7 @@ yes' implies gnu ld, otherwise MSVC++ (which I haven't tested since I inheritted the code from Ian Lance Taylor btw!) is implied. -1999-01-28 Gary V. Vaughan +1999-01-28 Gary V. Vaughan * ltmain.in: Reverted this change of Alexandre's from the 1999-01-25; "don't try to use .o instead of .lo just because @@ -770,7 +770,7 @@ AM_PROG_LIBTOOL Reported by Jeff Garzik -1999-01-27 Gary V. Vaughan +1999-01-27 Gary V. Vaughan * THANKS: Now that we have a policy, applied it to the existing list. This in no way demeans the work of those people removed @@ -876,7 +876,7 @@ message, and added a warning about inter-library dependencies even for non-module builds -1999-01-26 Gary V. Vaughan +1999-01-26 Gary V. Vaughan * Makefile.am (install-data-hook): Don't show the if expression that tests for gzip with a conditional error message; just do it @@ -981,7 +981,7 @@ anything about the format of the date, just that it does not contain `$' -1999-01-22 Gary V. Vaughan +1999-01-22 Gary V. Vaughan * configure.in (date): echo the version number during configuration, and show $date for cvs versions. @@ -1004,7 +1004,7 @@ * ltconfig.in, ltmain.in (TIMESTAMP): append timestamp to most references to VERSION -1999-01-22 Gary V. Vaughan +1999-01-22 Gary V. Vaughan * ltmain.in (ild): Revert the change which allowed libtool to link libraries with dependencies on .la libs. @@ -1037,7 +1037,7 @@ * demo/configure.in, demo/Makefile.am (DLPREOPEN): reverted; it didn't make any difference. -1999-01-21 Gary V. Vaughan +1999-01-21 Gary V. Vaughan * THANKS: Added Chris Laas @@ -1167,7 +1167,7 @@ * mdemo/main.c (LTDL_PREOPENED_SYMBOLS): remove -1999-01-20 Gary V. Vaughan +1999-01-20 Gary V. Vaughan * TODO: Added inter-library deps for ltlibs. @@ -1224,7 +1224,7 @@ flags to LDADD * doc/libtool.texi (Using Automake): how to add -dlopen to LDADD -1999-01-19 Gary V. Vaughan +1999-01-19 Gary V. Vaughan From Andrey Slepuhin * ltmain.in (hardcode_action) Oops, misapplied the patch! @@ -1334,7 +1334,7 @@ (find_module) tryall_dlopen old_name first, so that we don't override statically linked symbols with dlopened ones -1999-01-15 Gary V. Vaughan +1999-01-15 Gary V. Vaughan From Andrey Slepuhin * libtoolize.in (cd $pkgdatadir): Make sure we return the the @@ -1381,7 +1381,7 @@ * mdemo/Makefile.am: use -export-dynamic until libtool and libltdl are able to handle module dependencies -1999-01-14 Gary V. Vaughan +1999-01-14 Gary V. Vaughan * THANKS: added Mark Elbrecht. * ltconfig.in (PATH_SEPARATOR): new variable to hold valid $PATH @@ -1508,7 +1508,7 @@ (@DIST_MAKEFILE_LIST@): create subdir if needed, then run configure. On-demand configuration of subdirs at distribution time was - suggested by Gary V. Vaughan + suggested by Gary V. Vaughan * libtool.m4, ltconfig.in (NM): search for NM in PATH before /usr/ccs/bin, /usr/ucb and /bin. However, if the found one isn't @@ -1565,7 +1565,7 @@ * mdemo/configure.in: check only for math.h (string.h is no longer necessary) -1999-01-12 Gary V. Vaughan +1999-01-12 Gary V. Vaughan * configure.in (ltdl-install): Fixed up the indentation so that `configure --help' is pretty again. @@ -1659,12 +1659,12 @@ non-libtool modules, dlopen with the flags GLOBAL and NOW * mdemo/main.c: report the error using lt_dlerror() -1999-01-08 Gary V. Vaughan +1999-01-08 Gary V. Vaughan * doc/libtool.texi (old_archive_from_new_commands): Documented this ltcofig variable. -1999-01-07 Gary V. Vaughan +1999-01-07 Gary V. Vaughan * ltmain.sh (cygwin, allow_undefined): Unfortunately, there are problems with this variable when trying to make a dll which has @@ -1680,7 +1680,7 @@ * libltdl/ltdl.c: assigned copyright to the FSF * libltdl/ltdl.h, mdemo/foo*,main.c: likewise -1999-01-06 Gary V. Vaughan +1999-01-06 Gary V. Vaughan * ltmain.in (dllsearchpath): add absolute directory paths to dllsearchpath so that the wrapper scripts can be called from any @@ -1812,7 +1812,7 @@ USE_DLPREOPEN was defined, integrated shl_load code from GModule (still untested) -1998-12-24 Gary V. Vaughan +1998-12-24 Gary V. Vaughan * libltdl/configure.in: fixup spacing in --enable-ltdl-install help string so that it lines up nicely for configure --help. @@ -1853,7 +1853,7 @@ * mdemo/Makefile.am (mdemo_debug_LDADD, mdemo_debug_DEPENDENCIES): use libltdl.la -1998-12-23 Gary V. Vaughan +1998-12-23 Gary V. Vaughan * doc/PLATFORMS: added my cygwin32 box (i686-pc-cygwin32). @@ -1912,7 +1912,7 @@ * libltdl/configure.in: warn if dlopen is not supported * mdemo/Makefile.am (mdemo.debug): use libltdls -1998-12-22 Gary V. Vaughan +1998-12-22 Gary V. Vaughan * ltconfig.in: revert Thomas Tanners change to create all libraries without the `lib' prefix on win32, otherwise `gcc foo.c @@ -1934,7 +1934,7 @@ * depdemo/.cvsignore: renamed hell* to depdemo*, added *.lo,*.la * mdemo/.cvsignore: ditto -1998-12-21 Gary V. Vaughan +1998-12-21 Gary V. Vaughan * libtool.m4 (AM_SYS_NM_PARSE): apparently __ptr_t is predefined on some systems - use lt_ptr_t instead. @@ -2006,7 +2006,7 @@ demo), updated the documentation, import sin and cos in main program rather than linking libfoo1 statically -1998-12-17 Gary V. Vaughan +1998-12-17 Gary V. Vaughan * libtool.m4 (AM_PROG_LIBTOOL): Added AC_PREREQ(2.12) to prevent people using libtool with old autoconfs that don't provide the @@ -2122,7 +2122,7 @@ (*demo/Makefile.in): don't update autoconf/automake files any more; make check is needed -1998-12-14 Gary V. Vaughan +1998-12-14 Gary V. Vaughan * ltconfig.in (archive_cmds): tweaked for cygwin b18->b20.1 compatibility and fixed a bug with generating the export @@ -2152,7 +2152,7 @@ * libltdl/Makefile.am (noinst_HEADERS): don't install ltdl.h yet (noinst_LTLIBRARIES): ditto for libltdl.la -1998-12-08 Gary V. Vaughan +1998-12-08 Gary V. Vaughan * README-alpha: adapted the release procedure from automake/HACKING. @@ -2198,7 +2198,7 @@ * ltmain.in: use sys_lib_search_path, removed extradeplibs (they're not portable) -1998-12-02 Gary V. Vaughan +1998-12-02 Gary V. Vaughan * libltdl/configure.in: look for string.h or else strings.h, and also check for ANSI strrchr() function. Fix `undescore before @@ -2223,7 +2223,7 @@ * mdemo/modules/Makefile.am: replaced -export-symbols with -export-dynamic since it doesn't work for modules -1998-12-01 Gary V. Vaughan +1998-12-01 Gary V. Vaughan * README: Updated homepage pointer to gnu libtool page. @@ -2246,7 +2246,7 @@ * config.guess, config.sub: imported from autoconf pre-2.13 -1998-11-27 Gary V. Vaughan +1998-11-27 Gary V. Vaughan * libtool (AM_PROG_LD): Oops... we need to know the host_os for the changes below. I'm not sure whether mingw32 and os2 support @@ -2401,7 +2401,7 @@ * PORTING: new file, with general instructions and inter-library dependencies tips -1998-11-11 Gary V. Vaughan +1998-11-11 Gary V. Vaughan * ltconfig.in: make use of '~' field separator in reload_cmds, old_archive_from_new_cmds, old_archive_cmds, archive_cmds, @@ -2477,7 +2477,7 @@ modules * tests/Makefile.am, tests/mdemo*: added some tests for mdemo -1998-11-04 Gary V. Vaughan +1998-11-04 Gary V. Vaughan * demo/configure.in: added AC_EXEEXT macro so that the tests can work on cywin32/mingw32 hosts. This requires the current CVS diff --git a/ChangeLog.1 b/ChangeLog.1 index 970f67de0..22da5effd 100644 --- a/ChangeLog.1 +++ b/ChangeLog.1 @@ -1,3 +1,1901 @@ +2000-06-04 Mark Mitchell + + * ltcf-c.sh (archive_cmds, archive_expsym_cmds) [solaris, + with_gcc]: Use `gcc -shared' to build a shared library. + +2001-06-04 John David Anglin + + * ltcf-c.sh (archive_cmd) [hpux, with_gcc]: Use gcc to link shared + archives. + +2001-05-28 Simon Patarin + + * ltcf-cxx.sh (osf3/osf4/osf5): Support creation of C++ shared + libraries when using g++ with native linker. + +2001-05-28 Albert Chin + + * ltconfig.in (version_type, soname_spec) [aix4* | aix5*]: Use + linux-style versioning, and remove trailing .o from soname_spec. + +2001-05-22 Alexandre Oliva + + * ltcf-cxx.sh (allow_undefined_flag, no_undefined_flag) + [aix4*|aix5*]: Prepend blank. + +2001-05-20 Alexandre Oliva + + * configure.in: Reverted to 1.4, to avoid confusion with MLB. + Mainline is the release snapshot, except for the ChangeLog version + number, until the multi-language branch is merged into it. + + * ltconfig.in: Fix sh.test regression introduced in previous patch. + + * ltconfig.in (lt_cv_sys_max_cmd_len): Improve test to work better + in case of non-built-in echo. Set bounds correctly. + + * ltcf-cxx.sh (allow_undefined_flag) [aix4* | aix5*]: Fix quote + error. + + * ltmain.in (exec_cmd): New variable. Don't exec programs within + the big `case'; set the variable instead, and exec the cmd + afterwards, so that the shell gets a chance to clean up here-doc + files. + * NEWS: Update. + +2001-05-16 Alan Modra + + * libtool.m4 (lt_cv_deplibs_check_method): pass_all for hppa*-linux. + +2001-05-03 Andreas Jaeger , Andreas Schwab + + * ltmain.in (relink_command): Arrange for wrapper script to save + output to a variable and display it only if relinking fails. + +2001-04-25 Gary V. Vaughan + + * configure.in: bumped version to 1.4a. + + GNU libtool 1.4 was released. + + * configure.in: Bumped version to 1.4. + * config.sub, config.guess: Synchronised from ftp.gnu.org. + * NEWS: updated. + +2001-04-24 Peter Eisentraut + + * libtool.m4: Support $host_os as /sysv5uw7*/ from newer + config.guess in addition to older /unixware*/. Use compiler + driver, not linker, for linking shared libraries. + +2001-04-24 Gary V. Vaughan + + * libtool.m4, ltmain.in, libltdl/configure.in, + tests/quote.test: Remove stale references to ltconfig. + + * ltdl.m4 (AC_C_INLINE): No longer required. + * libltdl/ltdl.c (strdup, strcmp, strchr, strrchr, memcpy, trim, + free_vars): Revoke inline keyword from declarations. `static + inline' is not very portable, and in addition Unixware 7.1.1's + compiler says you can't access static variables from inline + functions. + Reported by Peter Eisentraut + +2001-04-24 Albert Chin-A-Young + + * libtool.m4: Handle case where /bin/nm -p outputs multiple + symbol types (like under HP-UX 11.00). + +2001-04-24 Thomas Tanner + + * TODO: describe problems with libltdl + * ltmain.in (ILD): tidy up, add comments, remove dead code, + merge duplicate code + * ltmain.in (ILD): don't touch newdependency_libs after scan or + dlopen pass + * ltmain.in (ILD): don't dlpreopen dependency_libs of a dlopened + module (remove absolutely wrong quick hack) + * ltmain.in (ILD): remove wrong comments about duplicate removal + * ltmain.in (ILD): build a static-only module if it has + static libraries in its dependencies (so that libltdl can + safely load dependency_libs) + * ltmain.in (argument parsing): prefix comparsions of -l args with X, + replace -lc with `-framework System' _after_ the ILD passes + * ltmain.in (argument parsing): support dl[pre]open + for both .o and .lo files + * ltmain.in (deplibs_check): use portable test syntax + * ltmain.in (help): document -prefer-[non-]pic flags + * ltmain.in: improve readablity by adding some comments, + rename uninst_* to notinst_* (more adequate name) + +2001-04-24 Gary V. Vaughan + + * doc/PLATFORMS: More updates from subscribers to + libtool@gnu.org. + + From Tim Mooney + * tests/Makefile.am (TESTS_ENVIRONMENT): Make sure the *.test + scripts get the same make that was used in the top level + directory. + +2001-04-23 Gary V. Vaughan + + * doc/PLATFORMS: Updated with more platforms successfully + tested by members of libtool@gnu.org. + +2001-04-23 Peter Eisentraut + + * doc/PLATFORMS: With this patch, freebsd4.3 passes the test + suite. + * libltdl/ltdl.c (lt_dlexit): Quit loop if only resident modules + are left. + +2001-04-23 Gary V. Vaughan + + * doc/PLATFORMS: With this patch, my Solaris boxes now pass the + test suite, Yay! + From Albert Chin-A-Young + * ltmain.in: `test -L' is not portable, and infact breaks uninstall + mode on Solaris. Fallback to `test -h' and finally `test -f', + but be careful not to let the failure status cause libtool to + stop. + + From Simon Spero + * ltdl.m4 (AC_LTDL_DLSYM_USCORE): Add $LIBADD_DL while + checking for dlsym _. + + From Simon Spero + * libtool.m4 (lt_cv_deplibs_check_method) [darwin]: Set it! + + * TODO: Make a note to undo this later. + From Christoph Pfisterer + * libtool.m4: Use $() execution substitution quotation to work + around zsh builtin echo \ escape removal. + +2001-04-22 Peter Eisentraut + + * bootstrap: Allow overriding the location aclocal, automake, + autoconf, autoheader from the environment. + + * demo/Makefile.am: Automake 1.4e does not allow `+=' assignments + if the variable was not set with `=' earlier. `+=' was not useful + here anyway. + +2001-04-22 Gary V. Vaughan + + * ltdl.m4 (AC_CHECK_HEADERS): UW7 has sys/dl.h, so we must + check for that here. + * libltdl/ltdl.c (HAVE_SYS_DL_H): Include it if necessary for + the dlopen loader. + Reported by Matthew Schalit + + * libtool.m4 (AC_DEPLIBS_CHECK_METHOD): Use pass_all for + various releases of UnixWare and OpenServer that support it. + Reported by Matthew Schalit + + * doc/PLATFORMS: Updated with various platforms successfully + tested by members of libtool@gnu.org. + +2001-04-21 Gary V. Vaughan + + * TODO: propose pkg-config merge. + +2001-04-21 Nick Hudson + + * ltmain.in: Correct an error in yesterday's patch. + +2001-04-20 Nick Hudson + + * libtool.m4: Improve NetBSD support. + * ltmain.in: ditto. + +2001-04-19 Dan McNichol + + * libtool.m4: Build standard shared libraries on AIX POWER + more like AIX does, with a shared object archived into lib.a. + On AIX -bexpall flag does strange things... Don't use it. + Fix quotes around -berok flag. Add support for AIX 5. + Add support for run time linking on AIX POWER. (should work + on AIX 4.2 and up). Turn this feature on by adding -brtl flag + to LD_FLAGS. Add support for AIX on IA64. Note: AIX on IA64 + uses a SYSV type linker. Add a comment telling what to do if the + TOC starts getting too large on AIX. + * NEWS: mention aix5 support. + +2001-04-18 Alexandre Oliva + + * TODO: Add -L- flag. + +2001-04-11 Alexandre Oliva + + * libtool.m4 (no_undefined_flag) [Solaris ld]: Change to -zdefs. + +2001-04-11 Ossama Othman + + * AUTHORS: Added myself to the list of maintainers. + +2001-04-08 Gary V. Vaughan + + * libtool.m4 (hardcode_libdir_flag_spec, osf4/osf5): Use ${wl} + to pass -rpath when compiling with gcc. + Reported by Tim Mooney + + * libltdl/ltdl.c (sys_shl_open): Cache a handle for the `self' + module, since HPUX adds module symbols into the `self' pool if + it is opened later. Return the cached pointer if the caller + subsequently tries to open `self'. + (sys_shl_sym): Diagnose NULL modules. + + From Peter Eisentraut + * ltmain.in (clean,uninstall): test -e is not portable. Well, + neither is -L, but I'm hoping that redirecting error messages + to /dev/null and relying on non-zero exit status will work okay + on the few hosts that don't support -L. + +2001-04-08 Nick Hudson + + * ltmain.in: Improve check for valid -version-info parameter. + +2001-04-08 Gary V. Vaughan + + From Nick Hudson + * doc/Makefile.am (libtool_TEXINFOS): Add fdl.texi so that it + is included in the distribution. + +2001-04-07 Peter Eisentraut + + * ltmain.in (clean,uninstall): Do not error if the file doesn't + exist and 'rm -f' was used. Exit with status 1 on error. + +2001-04-06 Nick Hudson + + * ltmain.in: Implement a new deplibs_check_method called + match_pattern that does pattern matching on filenames... + * libtool.m4: ...use it with NetBSD + +2001-04-05 Gary V. Vaughan + + * doc/libtool.texi (Multiple dependencies): A note about the + problems I've reintroduced by reverting the my patch of 2001-03-31. + + From Edward Lee + * libtool.m4: Typos. + + * tests/Makefile.am (TESTS): Delete references to depdemo-dups.test. + * tests/depdemo-dups.test: Removed, as part of the patch + reversion below. + * ltmain.in: Revert my change from 2001-03-31. Although it + was technically correct, it opens a whole can of worms we don't + want to deal with right now. + + From Ahmed Masud + * libltdl/ltdl.c (sys_shl_open): Return a NULL module handle + for self opening. + (sys_shl_close): Be careful not to close a NULL module handle. + (sys_shl_sym): Allow shl_findsym() to open NULL modules, but + discard the modified module address it returns. + + * libltdl/ltdl.c (lt_dlopen): When reading the .la file, + reallocate the line buffer size if the line overflows the + original buffer. + Reported by Nick Hudson + + * NEWS (1.3d) Removed bogus ltconfig reference. + +2001-04-03 Gary V. Vaughan + + * libtool.m4 (_LT_AC_LTCONFIG_HACK): Remove the spurious + `dnl' from the help text of --with-pic. + Reported by stefan + +2001-04-02 Gary V. Vaughan + + * configure.in: bumped version to 1.3e. + + GNU libtool 1.3d was released. + + * NEWS: inserted todays date. + +2001-04-01 Christoph Pfisterer + + * libtool.m4: Fixed support for Darwin and Rhapsody. Now correctly + hardcodes the library path and adds versioning. Other small + fixes. + * ltmain.in: Fixed special cases for libc and libm on Rhapsody and + Darwin. One of them was misplaced. Added version_type case for + Rhapsody and Darwin, named "darwin". + +2001-03-31 Gary V. Vaughan + + * ltmain.in: Remove the code for stripping duplicate deplibs + from libtool link lines -- duplicates are somtimes necessary + to satisfy inter-library dependencies, and never cause link to + fail even if they are spurious. + * tests/depdemo-dups.test: New file. Make sure this bug doesn't + creep back in again! + * tests/Makefile.am (TESTS): Use the new test above. + +2001-03-29 Edward M. Lee + + * libtoolize.in: Check configure.ac and prefer configure.ac to + configure.in. + + * libtoolize.in: change recommendation from AM_PROG_LIBTOOL to + AC_PROG_LIBTOOL. + + * libtool.m4: Generate dll/import libraries for cygwin according + to the following: libFOO.a (static lib), libFOO.dll.a (import + lib), cygFOO-version.dll (dll). Update postinstall_cmds and + postuninstall_cmds to reflect this. + * ltmain.in: Generate installed .la files with dlnames set to + ../bin/cygFOO-version.dll for normal dlls. dlls for modules + remain with the .la file. + + * libltdl/ltdl.c: Use windows paths while calling LoadLibrary. + +2001-03-16 Albert Chin + + * libtool.m4 (save_CPPFLAGS): Fix typo. + +2001-03-13 Alexandre Oliva + + * libtool.m4 (lt_cv_compiler_c_o): Cache it. + (lt_cv_compiler_o_lo): Likewise. + +2001-03-09 Peter Eisentraut + + * ltmain.in (clean): Automatically remove $objdir (usually '.libs'). + +2001-03-08 Gary V. Vaughan + + * ltconfig.in (library_names_spec): Undo latin-1 spaces I pasted + in yesterday by mistake. + +2001-03-07 Gary V. Vaughan + + From Tor Lillqvist + * libtool.m4 (export_symbols): On Windows, if the export_symbols + file (which has been passed to libtool with the -export-symbols + command line switch) already is a .def file, use it as is. + + * libtool.m4 (library_names_spec): Using m4 quotes correctly this + time around! + + From Tor Lillqvist + * libtool.m4 (library_names_spec): Use an appropriate filename + prefix for dlls -- lib for mingw; cyg for cygwin; pw for pw32. + +2001-03-06 Alexandre Oliva + + * libtool.m4 (can_build_shared) [AIX 4.[01], GCC]: GCC up to + 2.96 can't build shared libraries reliably. Disable them. + + * ltmain.in: When dropping dependencies of a -no-undefined + library, give up on building a shared library. + +2001-03-05 Akim Demaille + + * ltmain.sh: Don't quote the argument of case/esac and + assignments. + * libtool.m4: Likewise. + +2001-03-03 Markus F.X.J. Oberhumer , + Alexandre Oliva + + * libtool.m4: Added explicit return type to all C functions. + +2001-02-22 Gary Vaughan + + * NEWS: Updated. + * doc/libtool.texi (Thread Safety in libltdl): New node describing + the application the new MT API. + * libltdl/ltdl.h: Prototypes. + * libltdl/ltdl.c: Use these functions throughout the rest of + the file to provide thread locking. + (lt_dlmutex_register): New function to set callbacks for + multi-threaded calls into libltdl. + (lt_dl_mutex_lock): Type of a locking callback function. + (lt_dl_mutex_lock): Type of an unlocking callback function. + (lt_dl_mutex_seterror): Type of a callback function to save the + last libltdl error message in thread local storage. + (lt_dl_mutex_geterror): Type of a callback function to retrieve + the last saved error message from thread local storage. + +2001-02-20 Gary Vaughan + + * libltdl/ltdl.c (lt_dlcaller_register): dont set an unsigned + type to a negative number. + Reported by Guenter Millahn + +2001-02-05 Gary V. Vaughan + + From Nick Hudson + * ltdl.m4 (AC_LTDL_SYS_DLOPEN_DEPLIBS): netbsd* is able to + automatically load module deplibs without assistance from + libltdl. + +2001-02-02 Gary V. Vaughan + + * libltdl/ltdl.c (load_deplibs): Make sure the depcount is reset, + even when deplibs are not used because of the patch below. + + * ltdl.m4 (AC_LTDL_SYS_DLOPEN_DEPLIBS): If we know that the host + architecture automatically loads deplibs, then... + * libltdl/ltdl.c (load_deplibs): ...don't manually load each one. + +2001-01-31 Gary V. Vaughan + + * TODO: Updated. + + * libltdl/ltdl.c (load_deplibs): If loading a deplib fails, + don't sweat -- it may be a lib that is already statically linked + into the loading application. + + * libltdl/ltdl.c: Clean up the shadowing of the global handles + variable. + (LT_DLRESIDENT_FLAGS): Add extra parens to satisfy -Wall. + (load_deplibs): Cast isspace() argument to an int to satisfy + -Wall. + +2001-01-30 Robert Boehne + + * AUTHORS: added myself to the list of maintainers. + +2001-01-28 Alexandre Oliva + + * libltdl/Makefile.am (CLEANFILES): Clean conditionally-built + libraries. + +2001-01-27 Alexandre Oliva + + * libtool.m4 (ld_shlibs) [aix4*]: Disable on unknown CPU types. + +2001-01-07 Gary V. Vaughan + + * NEWS: Updated. + * doc/libtool.texi (User defined module data): Updated. + * libltdl/ltdl.c (lt_dlhandle_next): New function. + * libltdl/ltdl.h (lt_dlhandle_next): Prototypes. + +2001-01-05 Gary V. Vaughan + + * NEWS: Updated. + * doc/libtool.texi (User defined module data): Document it all. + * ltdl.m4: Check for memcpy, or else bcopy. + * ltdl.c (lt_caller_data): New type. + (lt_dl_handle_struct): Add an lt_caller_data field. + (lt_dlcaller_register, lt_dlcaller_set_data, + lt_dlcaller_get_data): New functions. + (rpl_memcpy): A minimal fallback implementation. + (rpl_realloc): A realloc implemented with lt_dlmalloc and + lt_dlfree. + (LT_DLMALLOC, LT_DLFREE, LT_DLREALLOC, LT_DLMEM_REASSIGN): + New memory handling convenience macros. Use them + appropriately throughout the rest of this file. + * ltdl.h (lt_dlcaller_register, lt_dlcaller_set_data, + lt_dlcaller_get_data): Prototyped. + +2001-01-04 Gary V. Vaughan + + * libltdl/ltdl.h: formatting change. + +2000-12-23 Gary V. Vaughan + + From vvv@vsu.ru: + * doc/fdl.texi (GNU Free Documentation License): contained @bye + command which prevented part of document to be generated (indices, + etc). + * doc/libtool.texi (Dlpreopening): the @deftypevar did not contain + a space after a type. + +2000-12-22 Akim Demaille + + * libtool.m4: s/[ \t]*$// + +2000-12-22 Aneesh Kumar K.V + + * libtool.m4 (OSF/1): Revert my patch of 2000-12-16. + +2000-12-20 Gary V. Vaughan + + * libltdl/ltdl.c (lt_dlexit): Was checking for residency of the + wrong module. + Reported by Robert Boehne + + * ltmain.in (dlprefiles): Now that `2000-12-15 Utz-Uwe Haus' patch + below can detect preopened library deplibs correctly in libltdl, + we need to ensure that libtool library deplibs are also preloaded + into the binary for that phase to work. + +2000-12-16 Aneesh Kumar K.V + + * libtool.m4 (OSF/1): Change the way to pass linker flags through + compiler on a Tru64 machine. + +2000-12-16 Gary V. Vaughan + + * libtool.m4 (sys_lib_search_path_spec): Use test instead of + `['. + (archive_cmds): And another one. + + * libtool.m4 (darwin*): Fixed a pair of stupid typos I made in the + last patch. + + * libtool.m4 (AC_DEPLIBS_CHECK_METHOD): moved rogue settings from + sequent, ncr and newos6 back into here from other macros. + +2000-12-16 Wilfredo Sanchez + + * libtool.m4: (dyld/darwin*) Much improved port. + * ltmain.in: (dyld/darwin*) Much improved port. + +2000-12-16 Sascha Schumann + + * libtool.m4: Accept darwin as an alias for rhapsody. + * ltmain.in: ditto. + + * libtool.m4 (AC_DEPLIBS_CHECK_METHOD): Use the HPUX 10.20 + methods to check for library dependencies on HPUX 11. + +2000-12-16 Nick Hudson + + * libtool.m4 (netbsd*, deplibs_check_method): Enable ILD support + for NetBSD a.out. + +2000-12-15 Akim Demaille + + * libtool.m4 (AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE): Rename + `ac_cv_sys_global_symbol_pipe' as `lt_cv_sys_global_symbol_pipe'. + Similarly with `lt_cv_global_symbol_to_cdecl + (_LT_AC_LTCONFIG_HACK): Similarly with `ac_cv_prog_cc_pic', + `ac_cv_prog_cc_shlib', `ac_cv_prog_cc_wl', `ac_cv_prog_cc_static', + `ac_cv_prog_cc_no_builtin', `ac_cv_prog_cc_can_build_shared', + `ac_cv_prog_cc_static_works', `ac_cv_archive_cmds_need_lc'. + (AC_PATH_TOOL_PREFIX): Similarly with `ac_cv_path_MAGIC_CMD' + (AC_PROG_LD) : Likewise. + (AC_PROG_LD_GNU) : Likewise. + (AC_PROG_NM) : Likewise. + +2000-12-15 Utz-Uwe Haus + + * libltdl/ltdl.c (lt_dlopen): Changed "dl_dependency_libs" keyword + to "dependency_libs". + +2000-12-14 Tod Milam + + * libltdl/ltdl.c (lt_dlexit): Reset the loaders value to zero when + the last module has been unloaded. + +2000-12-14 Michael Schmitz + + * libtool.m4: Port to *-sni-sysv4 (Reliant Unix) + * README: added Reliant Unix to hte list of supported platforms + * doc/PLATFORMS: added note on tests on Reliant Unix + +2000-12-14 Masahiro Nobori + + * README: Updated. + * NEWS: Updated. + * libtool.m4: New port to NEWS-OS Release 6. + +2000-12-14 Nick Hudson + + * libtool.m4 (hardcode_libdir_flag_spec): Remove linker + specification for netbsd. + +2000-12-14 Akim Demaille + + * libtool.m4: Don't depend on Autoconf internals: + s/ac_cv_prog_gcc/GCC/. + +2000-12-14 Gary V. Vaughan + + * libtool.m4 (AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE): Don't empty + out ac_cv_global_symbol_to_cdecl inside the loop, incase we + need to go around again and try with underscore prefix. + (_LT_AC_TRY_DLOPEN_SELF): On some hosts (cygwin for instance) + self dlclosing unloads the main program and causes a SIGSEGV. So + don't do it for now. + +2000-12-05 Gary V. Vaughan + + Oh My! Cygwin support has bitrotted while I was looking the other + way. This should fix it some: + * libtool.m4 (extract_expsyms_cmds): There is a quoting problem + with autoconf-2.13 that prevents [$]0 from expanding. Use shell + quotes instead to delay eval of $0. + (impgen.c) The '# ' sequence stripped by sed works again. + +2000-12-01 Gary V. Vaughan + + * doc/libtool.texi (Libltdl interface): Add documentation. + * libltdl/ltdl.h (lt_dlmakeresident, lt_dlisresident): Add + prototypes. + (LT_DLERROR_CLOSE_RESIDENT_MODULE): New error status. + * libltdl/ltdl.c (lt_dlmakeresident, lt_dlisresident): Allow + making and testing of resident module status, which prevents a + module from being lt_dlclosed. + (lt_dlopen): If lt_dlopen()ing self, make the module resident. + (lt_dlclose): Return an error if the module is resident. + + * libtool.m4 (_LT_AC_LTCONFIG_HACK): Move the tests for dlopen + from here... + (AC_LIBTOOL_DLOPEN_SELF): ...to here. + (_LT_AC_CHECK_DLFCN): Factor out repeated code for dlfcn.h + (_LT_AC_TRY_DLOPEN_SELF): Factor out repeated code for + checking dlopen status. + * ltdl.m4 (AC_LIB_LTDL): Use _LT_AC_CHECK_DLFCN. + dlopen compile time checking. Use _LT_AC_CHECK_DLFCN. + (AC_LTDL_DLSYM_USCORE): Use _LT_AC_TRY_DLOPEN_SELF. + +2000-11-29 Gary V. Vaughan + + * libltdl/ltdl.h (lt_dlhandle): Rename the wrapped structure + to prevent nameclash when used from C++. + * libltdl/ltdl.c: Fixed all references. + +2000-11-25 Gary V. Vaughan + + * libltdl/ltdl.c (lt_dlopen): Change the default search order + for modules. If the named module has no directory component, + always start the search with the user_search_path directories, + and then fall back on the current directory only if that fails. + +2000-11-20 Gary V. Vaughan + + * libltdl/Makefile.am (libltdl_la_LDFLAGS): increment the version + number to reflect the breakage of binary compatibility. + * doc/libtool.texi (Libltdl interface): Document + LT_NON_POSIX_NAMESPACE. + * libltdl/ltdl.h (LT_POSIX_NAMESPACE): Deleted. The default is + now to use this namespace, so the cpp macro is no longer + necessary. + +2000-11-20 Morten Eriksen + + * ltdl.m4 (AC_LIB_LTDL, AC_LTDL_SYMBOL_USCORE): Break a circular + dependency between AC_LTDL_SYMBOL_USCORE and AC_LTDL_DLSYM_USCORE. + +2000-11-20 Paul Berrevoets + + * ltmain.in: Some versions of expr respond with "0" if a + regexp fails to match. + +2000-11-19 Paul Berrevoets + + * libtool.m4 (_LT_AC_LTCONFIG_HACK): Quote the $ in $#, $2 and + $3 in variable 'archive_expsym_cmds' for cygwin. + +2000-11-19 Gary V. Vaughan + + * ltdl.c: Relegate non-POSIX-compliant symbols (e.g. those + ending in ``_t'') to deprecated #define compatibility macros. + Also ease up on the namespace pollution, so that only ``lt_'' + and ``LT_'' prefixes are taken from the global namespace. + * ltdl.h: ditto. + +2000-11-17 Gary V. Vaughan + + * ltdl.c: Reformatted. + * ltdl.h: ditto. + +2000-11-11 Gary V. Vaughan + + * ltdl.m4 (AC_LTDL_SYMBOL_USCORE): Use $ac_ext for conftest + sourcefile. + * libtool.m4: Use $ac_ext and $ac_objext respectively for conftest + sources and objects. + Reported by Carlo Wood + + * doc/fdl.texi: New file. The license for distributing the + libtool manual. + * doc/libtool.texi: Reference the new license. + +2000-10-31 Morten Eriksen + + * libtool.m4 (_LT_AC_LTCONFIG_HACK): Quote argument to avoid + error output from cygpath when $srcdir is empty. + +2000-10-31 Gary V. Vaughan + + * bootstrap: rm Makefiles to prevent infinite loop during + configure when libtool.m4 is newer than Makefile. + +2000-10-31 Akim Demaille + + * libtool.m4: Adjust the copyright notice. + Quote all the macro names when defined. + Some minor formatting changes. + (AM_PROG_LIBTOOL, AM_ENABLE_SHARED, AM_ENABLE_STATIC) + (AM_DISABLE_SHARED, AM_DISABLE_STATIC, AM_PROG_LD, AM_PROG_NM): + Don't use indir when useless. Don't add trailing `dnl' either. + +2000-10-30 Gary V. Vaughan + + * doc/libtool.texi: Corrected another attack of CRLF line + endings. + +2000-10-30 Ossama Othman + + * libtool.m4 (archive_expsym_cmds): Fix typo where line was broken + in the middle of an expression. + +2000-10-30 Aneesh Kumar K.V + + * libtool.m4 (archive_expsym_cmds): Support for -export-symbol + option on Tru64. + (hardcode_libdir_flag_spec): Fixed cxx throwing error while using + libtool. Done by passing -rpath directlty to the compiler. + +2000-10-27 Robert Boehne + + * docs/libtool.texi: Added pointers to documentation + of Hewlett-Packard, Compaq Tru64 and IBM AIX systems. + +2000-10-02 Gary V. Vaughan + + From Bruce Korb + * ltmain.in (execute_dlfiles): Reduce obfuscation. + +2000-09-30 Alexandre Oliva + + * libtool.m4 [netbsd*] (deplibs_check_method, file_magic_cmd, + file_magic_test_file): Removed inappropriate duplicate + definitions; these variables are set in AC_DEPLIBS_CHECK_METHOD. + + * libtool.m4 (lt_cv_file_magic_cmd): Don't use '${MAGIC_CMD}' or + '${OBJDUMP}'; Solaris' /bin/sh loses with `}' in cache files. + (ac_cv_path_MAGIC_CMD): Renamed to lt_cv_path_MAGIC_CMD. + +2000-09-28 Gary V. Vaughan + + * libtool.m4 (MAGIC_CMD): Don't use MAGIC, since BSD versions of + the file command use this environment variable to hold the + location of the magic database. + Reported by Marc Espie + +2000-09-19 Gary V. Vaughan + + * doc/PLATFORMS: Updated. + * demo/configure.in: Revert to the `libtool --features' test. + * Makefile.am (libtool): This needs to rerun configure now that + libtool is generated entirely by AC_PROG_LIBTOOL again. + (ltconfig): Removed. + (ltmain.sh): Is now regenerated when ltmain.in changes. + * libtool.m4 (_LT_AC_LTCONFIG_HACK): Now does all of the work for + generating libtool immediately in configure.in, rather than + deferring part of the creation until config.status runs. + +2000-09-17 Gary V. Vaughan + + * bootstrap: Backed out yesterdays patch which is no longer + necessary. + * Makefile.am (libtool): Reworked rule for regeneration of libtool, + now that it is built entirely withing config.status. + (libtoolize): Tidied for orthogonality with the other generation + rules. + (ltconfig): This is now generated by AC_PROG_LIBTOOL, called from + make by running config.status --recheck. + (ltmain.sh): Moved primary generation of this file into here... + * configure.in (AC_OUTPUT): ...instead of here. + * libtool.m4 (AC_OUTPUT_COMMANDS): Write the config to ltconfig + where it can be reused, rather than directly to libtool. + * demo/configure.in: libtool is no longer present immediately + after AC_LIBTOOL_M4 has completed, so the tests now grep through + ltconfig instead -- which *will* be present. + +2000-09-16 Gary V. Vaughan + + * TODO: Removed the item describing the change below, and added a + similar item to remind us to change the ltdl.m4 macros again when + _LT_AC_LTCONFIG_HACK is divided into proper macros. + * ltdl.m4 (AC_LTDL_SNARF_CONFIG): Removed. No longet required + now that ltconfig has migrated to libtool.m4. + (AC_LTDL_SHLIBEXT): Require _LT_AC_LTCONFIG_HACK. + (AC_LTDL_SHLIBPATH): ditto. + (AC_LTDL_SYSSEARCHPATH): ditto. + + * ltdl.m4 (AC_LTDL_DLPREOPEN): Require the libtool.m4 symbol_pipe + macro. + (AC_LTDL_SYMBOL_USCORE): ditto. + (AC_LTDL_GLOBAL_SYMBOL_PIPE): Removed, since it is a duplicate + of... + * libtool.m4 (AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE): ...this new + macro, extracted from _LT_AC_LTCONFIG_HACK. + + * ltdl.m4 (changequote): An audit of changequote and m4 + quote usage -- all changequotes have been removed, and some + latent unquoted `[' and `]' bugs have been fixed. + + * configure.in (AC_OUTPUT): ltmain.sh must be generated in the + source tree since this is where it would be found in a freshly + unrolled tarball. + + * configure.in: Replace `dnl' comments with `#' comments for + more conformity with cvs autoconf. + Removed emacs hack-local-variables, since there is now a + proper Autoconf major mode. + Removed a couple of changequote()s. + + * bootstrap (ltconfig): When bootstrapping libtool with a + stock automake (i.e. without the README patch applied), + references to ltconfig are manually removed from the generated + Makefile.in files. + +2000-09-15 Gary V. Vaughan + + * doc/libtool.texi: Removes references to ltconfig, and a small + amount of tidying up to compensate. + +2000-09-15 Nick Hudson + + * libtool.m4 (netbsd): Improved support. + +2000-09-15 Gary V. Vaughan + + * ltmain.in (version_type): Use "-iface" as the windows + versioning scheme, where iface is the number of the oldest + interface supported. + +2000-09-14 Gary V. Vaughan + + From Paul Sokolovsky + * libtool.m4 (pw32): Initial support for pw32, assuming that + libtool's behaviour in this environment is identical to under + cygwin. + * ltmain.in (pw32): ditto. + * NEWS: Updated. + + * libtool.m4 (changequote): An audit of changequote and m4 + quote usage -- all changequotes (except a few with non-nesting + square brackets) have been removed. + + * Makefile.am (EXTRA_DIST): The bootstrap script should be + distributed with libtool. + +2000-09-13 Gary V. Vaughan + + libtool.m4 (_LT_AC_LTCONFIG_HACK): Oh man! Third time lucky. + I just discovered that '&' needs to be escaped inside + AC_TRY_EVAL. + +2000-09-12 Michael Matz + + * ltmain.in: Be careful about filenames with multiple `.'s in + them when calculating file extensions. + Reported by Joel Reed + +2000-09-12 Gary V. Vaughan + + libtool.m4 (AC_PROG_LIBTOOL): Removed, as it was triggering a + bug in Autoconf-2.13 AC_REQUIRE implementation which inserted + some of the expanded tests too early in the generaated configure. + (_AC_PROG_LIBTOOL): renamed to AC_PROG_LIBTOOL, and defines + itself to an empty expansion to prevent multiple expansions. + configure.in (AC_LIBTOOL_SETUP): Replaced by a call to + AC_PROG_LIBTOOL now that the AC_REQUIRE bug has been worked + around. + +2000-09-09 Gary V. Vaughan + + libtool.m4 (_LT_AC_LTCONFIG_HACK): Forgot to escape the + redirections inside AC_TRY_EVAL in the need_lc tests. Doh! + + libtool.m4 (_LT_AC_LTCONFIG_HACK): Forgot to redirect the + output of grep to /dev/null in the need_lc tests. + + configure.in (AC_PROG_LIBTOOL): Using this in libtools own + configure.in interacts badly with the AC_PROVIDE calls and + results in several tests being inserted into configure too + early. Use AC_LIBTOOL_SETUP instead. + +2000-09-08 Gary V. Vaughan + + libtool.m4 (_LT_AC_LTCONFIG_HACK): The ltconfig.in code I + ported from ltconfig.in was incomplete -- this is a backport + of the missing code taken from the multi-language branch. + +2000-09-07 Pavel Roskin + + * libtool.m4 (_LT_AC_LTCONFIG_HACK): Fixed incorrect use of + changequote + +2000-09-07 Gary V. Vaughan + + * NEWS: Updated. + * TODO: Add a reminder to get rid of ltconfig in mlb. + * README: Until things even out, I have added a note and a + patch to make the installed automake cooperate with the new + ltconfig free libtool. + + * libtool.m4 (_LT_AC_LTCONFIG_HACK): with_gcc is only useful in + ltmain.sh as it has not yet been set in libtool.m4. Use + $ac_cv_prog_gcc instead. + + * doc/PLATFORMS: Updated. + + * configure.in (AC_PROG_AWK): Removed -- no longer required by + the build process. + * lineno: ditto. + + * libtoolize.in (files): Don't try to install ltconfig -- it + doesn't exist!! + * bootstrap: Fake an ltconfig incase the installed automake + calls an installed libtoolize (as part of its --add-missing + process) which thinks ltconfig should be there. + + * libtool.m4 (_LT_AC_LTCONFIG_HACK): Deleted a vital `;;' + terminator from a case statement by mistake. + + * Makefile.am (ltmain.sh): Make this depend on TSDEPS again + so that the Changelog timestamp is used for ltmain.sh at `make + dist' time. + +2000-09-06 Gary V. Vaughan + + libtool.m4 now contains a version of the code that used to run + from ltconfig, so that ltmain.sh and then libtool are + generated at configure time. + + * Makefile.am: Don't generate ltmain.sh or ltconfig anymore. + * bootstrap: ltconfig is no more! + * configure.in: Call AC_PROG_LIBTOOL directly. + (AC_OUTPUT): Generate tmain.sh. + * libtool.m4: Don't build an argument list for ltconfig. + (_LT_AC_LTCONFIG_HACK): Refactoring of the former contents of + ltconfig.in to take advantage of the m4 macros from autoconf. + * ltmain.in: Don't do a version check against ltconfig. + * tests/assign.test: Remove reference to ltconfig. + * tests/hardcode.test: ditto. + * tests/sh.test: ditto. + +2000-09-05 Alexandre Oliva + + * depdemo/main.c: Support -alt. + * tests/build-relink2.test: Try it. + + * ltconfig.in: Removed all references to what used to be + hardcode_into_libs=all. 2000-09-03's patch was wrong. + * ltmain.in: Likewise. + * tests/build-relink.test, tests/build-relink2.test: Adjust. + * mdemo/Makefile.am (lib_LTLIBRARIES): Move libsub.la before + libfoo2.la, so that they're installed in the right order. + +2000-09-04 Alexandre Oliva + + * tests/dryrun.test: Build libsub.la along with the object files, + since it is needed by libfoo2.la. + + * mdemo/Makefile.am: Mark only libfoo2 as -no-undefined. + Explicitly link it with libsub.la. + + * ltconfig.in (need_lc): Preserve allow_undefined_flag. + + * tests/*.test (CONFIG_SITE): Ultrix's /bin/sh fails on + `. /dev/null'. Set CONFIG_SITE to /dev/null/config/site, to make + sure we pick a non-existent file. + + * Makefile.am (libtool, clibtool): Pass CONFIG_SHELL along with + ECHO down to ltconfig. + + * ltconfig.in (hardcode_libdir_flag_spec, export_dynamic_flag_spec): + Use ${wl}, not ${wlarc}. + + * ltmain.in (compile, need_lock): Don't create nor remove lock + files in dry runs. + + * libltdl/ltdl.c (load_deplibs): Don't append shlib_ext; use + lt_dlopenext() instead. + + * ltmain.in (link -static): Don't add $link_static_flag; only + -all-static should do that. + * mdemo/configure.in: Revert part of the previous delta. + + * mdemo/configure.in: Don't use -static on AIX4.1. + * mdemo/Makefile.am: Likewise. + +2000-09-03 Alexandre Oliva + + * ltconfig.in: Get rid of hardcode_into_libs=all; use + hardcode_into_libs=yes && shlibpath_overrides_runpath!=yes + instead. + [FreeBSD 3.[01]] (shlibpath_overrides_runpath): Set to no. + * ltmain.in: Likewise. + * tests/build-relink.test, tests/build-relink2.test: Adjust. + + * libtool.m4: Fix typo I introduced in yesterday's patch. + + * libltdl/ltdl.c (lt_dlopen): Set dlname from library_names if + dlname is empty. + + * ltdl.m4 (HAVE_LIBDL): Look for dlopen in -lsvld. + * ltconfig.in: Likewise. + + * tests/mdemo-exec.test: Modify failure message. + + * ltmain.in (newdlprefiles): Use dlname if it's available and + old_library isn't; use linklib only if dlname is not available. + + * ltconfig.in (enable_dlopen): Set to no when lt_cv_dlopen is no. + + * libtool.m4: Don't quote CONFIG_SHELL nor ORIGINAL_CONFIG_SHELL. + Quote $@ properly so that the shell expands it, not m4. + + * libtool.m4: Don't quote SHELL when `re-exec'ing, so that SHELL + can be `/path/to/shell -x'. + + * tests/quote.test: Move the match test out of case statements, to + work around bug in /bin/sh of several OSs. + + * ltmain.in (variables_saved_for_relink): Attempt to unset them + instead of setting them to an empty string. + +2000-09-02 Alexandre Oliva + + * ltconfig.in [with_gnu_ld] (archive_cmds, archive_expsym_cmds) + : Use compiler_flags instead of linker + flags. + Reported by Alex Hornby + +2000-09-02 Makoto Ishisone + + * libtool.m4 (lt_cv_deplibs_check_method, freebsd): Fix typo, + add support for compact format library. + +2000-09-02 Alexandre Oliva + + * ltdl.m4: Oops, I had forgotten to commit this part of Syd Polk's + patch from 2000-06-17. + +2000-09-02 Tom Kacvinsky , Tim Mooney + + * libtool.m4: Ignore Tru64's nm's complaint. + +2000-09-02 Pavel Roskin + + * ltconfig.in: only load $cache_file if it's a regular file + +2000-09-02 Assar Westerlund + + * ltconfig.in: Add back ranlib calls for static libraries if there + is a ranlib. + +2000-08-31 Gary V. Vaughan + + Move the echo detection code to a macro in libtool.m4. The code + at the top ofltconfig.in is ugly, but will go away when the rest + of ltconfig is migrated. + + * Makefile.am (libtool): Pass the value of $ECHO to ltconfig as + an environment variable. + * libtool.m4 (_LT_AC_PROG_ECHO_BACKSLASH): Quote the ECHO value + correctly so that it inserts the correct code into configure.in + suitably quoted for M4 expansion. This code needs to be near + the top of configure.in as it calls itself recursively, so I + am using AC_DIVERSION_NOTICE (or simply NOTICE on CVS + Autoconf). The value of ECHO is also substitued into the + Makefile to be used when Make calls ltconfig to generate + libtool, so another layer of quotation is required for the + Makefile. + (AC_LIBTOOL_SETUP): Use it. + * ltconfig.in: Accept a value for ECHO from the environment, and + carefully substitue for $0 if it is present in the ECHO value. + Because ECHO was quoted for Make, when ltconfig is called by + configure, it is overquoted, and one layer of quotes must be + stripped. + +2000-08-27 Gary V. Vaughan + + * ltconfig.in (with_gcc): Make the value of this option + available to the generated libtool script. + * ltmain.in (compile_command, finalize_command): The native C + and C++ compilers on IRIX require the -LANG:std in order to to + compile correctly. The same options should _not_ be passed + through to gcc on IRIX, or at all on other architectures for + backwards compatibility (among others). + Reported by Bob Friesenhahn + Reported by Albert Chin-A-Young + +2000-08-26 Gary V. Vaughan + + * ltconfig.in (old_reload_flag): typo. + +2000-08-01 Alexandre Oliva + + * ltmain.in (shtool): Use echo|grep instead of expr, as in the + original patch. + +2000-08-01 Alexandre Oliva + + * ltconfig.in (need_lc): Fix test message. + +2000-07-24 Mocha + + * ltconfig.in (NetBSD, deplibs_check_method): Use file_magic. + (NetBSD, file_magic_cmd, file_magic_test_file): Set. + +2000-07-24 Alexandre Oliva , David Kaelbling + + * ltmain.in (irix, major): Prepend a `.'. + * ltconfig.in (irix, soname_spec, library_names_spec): Adjust. + +2000-07-24 Alexandre Oliva , Ralf S. Engelschall + + * ltmain.in: Support GNU shtool's install. + +2000-07-24 Alexandre Oliva + + * ltconfig.in (linkopts): Don't set for test. + +2000-07-24 Nick Hudson + + * ltconfig.in (linkopts): Replace with linker_flags. + + * ltmain.in (ILD): Fix addition of deplibs in relink case. + +2000-07-18 H.J. Lu + + * ltconfig.in: Check if -lc is necessary for building shared + library. Set build_libtool_need_lc to indicate it. + * ltmain.in: Add -lc when building shared library only if + necessary. + +2000-07-10 Mo DeJong + + * libtool.m4 (AC_PROG_NM): Fix macro so that it + finds a cross NM on the PATH. + +2000-07-10 Ken Block + + * libltdl/ltdl.h: Also check for __cplusplus, __STDC__ is not + by Compaq C++ compiler + +2000-07-10 Alexandre Oliva + + * ltconfig.in (wlarc, netbsd, aout): Set to empty. + (hardcode_dynamic_flag_spec, export_dynamic_flag_spec): Use it. + + * ltconfig.in (dynamic_linker, linux, powerpc): Do not disable + shared libraries just because of MkLinux. + + * libtool.m4 (lt_cv_deplibs_check_method, freebsd): Do not depend + on $version_type; check for ELF support as in other BSDs. + +2000-06-17 Syd Polk + + * libtool.m4 (AC_LIBTOOL_SETUP): Do not generate a libtool based + on target; use host instead. + +2000-05-30 Gary V. Vaughan + + * ltconfig.in (ORIGINAL_CONFIG_SHELL): Prevent lossage when + the echo probing code falls into this branch without setting + this variable. + + * ltconfig.in (netbsd*): archive_cmds and archive_expsym_cmds + were reversed with respect to definition of __ELF__. + From Keisuke Inoue + +2000-05-29 Gary V. Vaughan + + * libtool.m4 (netbsd*): Use -L option to file_magic_cmd as for + freebsd (below). + * libtool.m4 (netbsd ELF): support file_magic. + From Dan Winship . + +2000-05-29 Steven M. Schultz + + * libtool.m4 (bsdi4*): Add -L option to bsdi4's file_magic_cmd + command. Under BSD/OS 4.1 several libraries are now symlinks + rather than regular files. Adding -L tells the file program + to follow the symlink. + +2000-05-29 Gary V. Vaughan + + * libtool.m4 (i*86-*-freebsd*): Forgot to changequote(,). + + * NEWS: Updated. + * libtool.m4 (i*86-*-freebsd*): Support a.out shared libs. + From + +2000-05-29 Fred Fish + + Support AR=mwld AR_FLAGS='-xml -o' for PPC Beos. + * ltconfig (old_AR_FLAGS): Add. + (old_archive_cmds): Use AR_FLAGS rather than hardcoding "cru". + (archive_cmds): Use AR_FLAGS rather than hardcoding "cru". + (AR_FLAGS): Default to "cru" if not set. + +2000-05-29 Gary V. Vaughan + + * ltconfig.in (echo): The following code actually prints the + double quotes -- so I removed them: + echo='printf "%s\n"' /bin/ksh -c '$echo \\t' + From Tuukka Toivonen + + * NEWS: Updated. + +2000-05-29 Bernhard Rosenkraenzer + + * libtool.m4: adding ia64 as supported linux platform + +2000-05-29 Michael Matz + + * ltmain.in: fix quoting for $var_value. + + * ltconfig.in: check for dlfcn.h: include return value + to make -Wall in CFLAGS work. + +2000-05-27 Gary V. Vaughan + + * README-alpha: note new location of config.(guess|sub). + +2000-05-27 Chad Cunningham + + * ltconfig.in (rhapsody*): New Port. + * ltmain.in (rhapsody*): ditto. + +2000-05-27 Chris Lattner + + * ltconfig.in (*-sequent-sysv4): New Port. + +2000-05-17 Gary V. Vaughan + + * ltmain.in: cygwin-1.1.0 and higher no longer grok backslash path + separators. + +2000-05-14 Alexandre Oliva + + * libtool.m4 (AC_LIBLTDL_CONVENIENCE, AC_LIBLTDL_INSTALLABLE): + Pick LIBLTLD from top_builddir and INCLTDL from top_srcdir. + * mdemo/configure.in: Remove comments on + AC_LIBLTLD_CONVENIENCE. + + * libtool.m4 (_AC_PROG_LIBTOOL): Renamed from... + (AC_PROG_LIBTOOL): Just AC_REQUIRE(_AC_PROG_LIBTOOL), to avoid + effects of multiple runs. + +2000-05-11 Thomas Tanner + + * NEWS: update + * doc/libtool.texi (libltdl): rename lt_(find|next|add|remove)_dlloader + to lt_dlloader_* + * libltdl/ltdl.c: ditto + * libltdl/ltdl.h: ditto, add declaration of lt_dlloader_(find|remove) + +2000-05-06 Pavel Roskin + + * libltdl/ltdl.c: Typo. + + * libtool.m4 (AC_LIBTOOL_SETUP): CVS autoconf no longer sets + target to "NONE", but to an empty string. + +2000-05-05 Paul Sokolovsky + + * ltdl.c: support lt_dlopen(0) for win32 + +2000-05-03 Thomas Tanner + + * doc/libtool.texi (libltdl): fix typos, + INCLTDL starts with top_srcdir, replace NULL with @code{NULL} + + * ltmain.in (ILD): search in newlib_search_path, too + + * ltmain.in (ILD): fix bugs in conv pass, expand convenience + libs to deplibs and link them later on + + * ltmain.in (ILD): don't allow convenience libs to be + -dlopen/preopen'ed + + * ltmain.in (ILD): it's not required to link all deplibs + in fast-install mode + + * ltmain.in (ILD): if hardcode_into_libs=all, only relink + a library if it is linked against uninstalled libtool libraries, + rename link_against_libtool_libs to uninst_deplibs + + * ltmain.in (ILD): tidy up, add some comments + +2000-05-03 John Wehle (john@feith.com) + + * libtool.m4 (hpux10.20*): use file_magic for + inter-library dependency tracking. + +2000-05-02 Gary V. Vaughan + + * AUTHORS: Update my email address. + * commit: ditto. + +2000-04-11 Thomas Tanner + + * NEWS: update + * libtool.m4: add AC_LIBTOOL_PICMODE + * ltconfig.in: move pic_mode checks to ltmain.in + * ltmain.in: add -prefer-pic and -prefer-non-pic + +2000-03-29 Alexandre Oliva + + * ltmain.in (tmpdir): Do not accept an existing directory, and + force its mode to 700, for security reasons. + Reported by Joseph S. Myers + +2000-03-27 Thomas Tanner + + * NEWS: reformatting + + * ltmain.in (ILD): add extra convenience library scanning pass + + * ltmain.in (ILD): accept -R flags for libraries, too + + * ltmain.in (ILD): correclty merge the dlpreopened libraries + with deplibs + + * ltmain.in (install mode): remove directories from filenames + before relinking (reported by Elrond ) + + * doc/libtool.texi (libltdl): rename Library -> Lesser, + clarify exception clause + * libltdl/ltdl.c, libltdl.h (License): ditto + +2000-03-21 Alexandre Oliva + + * ltconfig.in (variables_saved_for_relink): Set to `PATH + $shlibpath_var $runpath_var'. If with_gcc, add gcc-related + environment variables. Add it to the configuration section. + * ltmain.in (relink_command): Expand those variables. + +2000-03-14 Christopher A. Knight + + * ltconfig.in: added main() definition in compile + check for header `dlfcn.h' to fix link errors + when built with Sun Workshop Pro CC 4.2 (and perhaps + others). + +2000-02-03 Gary V. Vaughan + + * libltdl/ltdl.c (lt_find_dlhandle): Deleted. This was B.S. + far cleaner to use lt_dlforeach and lt_dlgetinfo. + * libltdl/ltdl.h: Prototype deleted. + * doc/libtool.texi: Documentation deleted. + * NEWS: annoncement deleted. + +2000-02-23 Thomas Tanner + + * ltmain.in: remove duplicates from deplibs, handle + interdependent libraries (e.g. -la -lb -la), + this requires adding deplibs in reverse order + + * ltmain.in: link dlpreopened libraries before other libraries + (reported by Pavel Roskin) + * mdemo/Makefile.am: build and link libsub.la + * mdemo/sub.c: new file used by both dlopened modules + * mdemo/foo*: use sub() defined in libsub + * tests/dryrun.test: build libsub.la + + * mdemo/Makefile.am: always link mdemo.static with -static + * mdemo/configure.in: ditto + + * ltmain.in: fix dlopen/dlpreopening of objects + + * ltmain.in (ILD): fix misplaced `continue' in -R* argument handler + + * ltmain.in: merge duplicated code of clean and uninstall mode + + * libtool.m4: recognize powerpc*linux* (reported by + Dirk A. Mueller ) + +2000-02-23 Gary V. Vaughan + + * ltconfig.in (old_MAGIC, old_STRIP, old_reload_flag, + old_deplibs_check_method, old_file_magic_cmd): New variabes. + Treat these as old_CC etc. + (STRIP, MAGIC): Create and set these variables in the generated + libtool script. + Reported by Pavel Roskin + + * configure.in: Due to a bug in autoconf-2.13 implementation of + AC_SUBST, `AC_SUBST(FILE)' can never work. Use MAGIC as the + holder of the command to run in file_magic_cmd instead. + * ltconfig.in: s/FILE/MAGIC/g. + * libtool.m4 (AC_PROG_LIBTOOL): set MAGIC in the environment when + calling ltconfig. + (AC_PATH_MAGIC): renamed from AC_PATH_FILE. + (AC_PATH_TOOL_PREFIX): s/FILE/MAGIC/g. Also set file_magic_cmd + to '${MAGIC}' so that make can grok it. + * Makefile.am (libtool): + (clibtool): ditto. + +2000-02-21 Gary V. Vaughan + + * libltdl/ltdl.c (lt_find_dlhandle): New function. + (tryall_dlopen): Use it. + * libltdl/ltdl.h: Prototype it. + * doc/libtool.texi: Document it. + * NEWS: updated. + + * libltdl/ltdl.c (lt_dlinit): removed unused variable, `loader'. + + * libltdl/ltdl.c (lt_remove_dlloader): typo, s/=/==/g. + +2000-02-03 Gary V. Vaughan + + * libltdl/ltdl.h (lt_dlloader_data_t): New type for loader + instance data. + (lt_user_dlloader): New lt_dlloader_data_t field. + (lt_module_open_t): Add lt_dlloader_data_t parameter. + (lt_module_close_t): Add lt_dlloader_data_t parameter. + (lt_find_sym_t): Add lt_dlloader_data_t parameter. + (lt_dlloader_exit_t): Add lt_dlloader_data_t parameter. + * libltdl/ltdl.c: A sprinkling of /*ARGSUSED*/ markers to + reassure lint that the unused arguments are intentional. + (lt_dlloader_t): New lt_dlloader_data_t field. + (lt_dlloader_data): New function to return the contents of the + dlloader_data field. + (sys_dl_open): Take an additional lt_dlloader_data_t argument. + (sys_dl_close): Ditto. + (sys_dl_sym): Ditto. + (sys_dl): Initialise lt_dlloader_data_t field. + (sys_shl_open, sys_shl_close, sys_shl_sym, sys_shl): As above. + (sys_wll_open, sys_wll_close, sys_wll_sym, sys_wll): As above. + (sys_bedl_open, sys_bedl_close, sys_bedl_sym, sys_bedl): As + above. + (sys_dld_open, sys_dld_close, sys_dld_sym, sys_dld): As above. + (presym_init, presym_exit, presym_open, presym_close, presym_sym, + presym): As above. + (lt_dlinit): Call presym_init with additional argument. + (lt_dlexit): Call dlloader_exit method with additional argument. + (tryall_dlopen): Call module_open method with additional argument. + (lt_dlclose): Call module_close method with additional argument. + (lt_dlsym): Call find_sym method with additional argument. + (lt_add_dlloader): Initialise dlloader_data field. + (lt_remove_dlloader): Call dlloader_exit method with additional + argument. + + * libltdl/ltdl.c (find_file): Prevent early release of memory + in filename/*pdir. + From Jon Leichter + + (sys_wll_init): Deleted. No longer required. And this time, + with feeling! + (sys_wll_exit): Ditto. + +2000-02-02 Gary V. Vaughan + + * NEWS: updated. + * doc/libtool.texi (Libltdl interface): Moved user defined module + loader documentation from here... + (Module loaders for libltdl) ...to here, and updated the text and + added examples. + * ltdl.m4 (AC_CHECK_FUNCS): check strcmp for lt_find_dlloader. + * libltdl/ltdl.h: Reformatted and commented for readability. + (struct lt_user_dlloader): New data type for passing + initialisation pointers to lt_add_dlloader. + (LTDL_ERROR_INVALID_LOADER): New error message when non loader + handles are passed to the user loader API. + (LTDL_ERROR_INIT_LOADER): New error when loader initialisation + fails. + (LTDL_ERROR_REMOVE_LOADER): New error when loader removal fails. + (lt_module_open_t): renamed from lt_lib_open_t. + (lt_module_close_t): renamed from lt_lib_close_t. + (lt_dlloader_exit_t): renamed from lt_dlloader_exit_t. + * libltdl/ltdl.c: Reordered builtin loaders so that the "dld" + loader no longer occurs before "dlopen" on some platforms and + after it on others. + (lt_dlloader_t): Moved here from ltdl.h, added a field, + "loader_name", for identifying the loader, and renamed from + lt_dltype_t. Renamed type variables to loader IFF of type + lt_dlloader_t. + (lt_module_t): Renamed from lt_syshandle. Renamed handle variables + to module IFF of type lt_module_t. + (LTDL_TYPE_TOP): Deleted. No longer required. + (sys_dl): Initialised as a struct lt_user_dlloader. + (sys_dl_init): Deleted. No longer required. + (sys_dl_exit): Ditto. + (sys_shl): Initialised as a struct lt_user_dlloader. + (sys_shl_init): Deleted. No longer required. + (sys_shl_exit): Ditto. + (sys_wll): Initialised as a struct lt_user_dlloader. + (sys_wll_init): Deleted. No longer required. + (sys_wll_exit): Ditto. + (sys_bedl): Initialised as a struct lt_user_dlloader. + (sys_bedl_init): Deleted. No longer required. + (sys_bedl_exit): Ditto. + (sys_dld): Initialised as a struct lt_user_dlloader. + (sys_dld_init): Deleted. No longer required. + (sys_dld_exit): Ditto. + (sys_presym): Initialised as a struct lt_user_dlloader. + (lt_mod_init_t): Moved to here from ltdl.h. + (lt_dlinit): Add builtin loaders using the user loader API. + (lt_dlexit): Unregister and free all loaders. + (lt_add_dlloader): New function to add a new module loader after the + loader specified in the argument. + (lt_remove_dlloader): New function to remove a module loader. + (lt_next_dlloader): New function for iterating over module loaders. + (lt_dlloader_name): Accessor function for name of dlloader. + (lt_find_dlloader): New function to get a reference to a registered + module loader. + (strcmp): static implementation incase the host has none. + (lt_dlgettypes, lt_dlsettypes): Removed. + +2000-02-02 Thomas Tanner + + * libltdl/ltdl.c: replace NULL with 0, remove unused system + and app_private pointers from lt_dlhandle_t + * libltdl/ltdl.c (presym_add_list): new preloaded symbols + don't need to be added to the end + + * libltdl/ltdl.c (lt_dlgetdata, lt_dlsetdata): removed + * libltdl/ltdl.h: ditto + * doc/libtool.texi (libltdl interface): ditto + +2000-02-01 Thomas Tanner + + * ltmain.in: support -dlopen/dlpreopen for libraries + * NEWS: updated + * TODO: updated + * ltmain.in: rename dlopen to dlopen_support + * ltconfig.in: ditto + * doc/libtool.texi: ditto + + * ltmain.in: check whether libraries are moved out of $libdir, + replace .a and .lib with .$libext, .o and .obj with .$objext + +2000-01-31 Gary V. Vaughan + + * libltdl/ltdl.h (lt_dlrealloc): removed declaration. + * libltdl/ltdl.c (lt_dlrealloc): removed definition. + (lt_dladderror): Instead of calling lt_dlrealloc, use lt_dlmalloc, + and lt_dlfree. + +2000-01-30 Ossama Othman + + * libtool.m4 (lt_cv_cc_needs_belf): Set the test language to C + prior to executing the test that checks if the C compiler needs + "-belf." + Reported by Chris Butler + +2000-01-28 Gary V. Vaughan + + * libtool.m4 (AC_DEPLIBS_CHECK_METHOD): Use changequote to + protect `[' and `]' in deplibs_check_method. + + * libltdl/ltdl.h (lt_dlrealloc): Added declaration. + * libltdl/ltdl.c (lt_dlrealloc): Added default definition. + + * libltdl/ltdl.c (lt_dlseterror): Catch errorcodes below 0 as + invalid. + * libltdl/ltdl.h (LTDL_ERROR): Added missing '_' in K&R + definition. + + * libltdl/ltdl.h (ltdl_error_table): Added missing error code, and + fixed typo in another code. + * doc/libtool.texi (Libltdl interface): Added missing @end + clause. + +2000-01-27 Thomas Tanner + + * ltconfig.in: Oops, replace the remaining $objdir's + + * ltmain.in: merge library linking code of programs and libraries, + some cleanups + +2000-01-27 Gary V. Vaughan + + * NEWS: Updated. + * doc/libtool.texi (Libltdl interface): Document new entry + points. + * libltdl/ltdl.c (lt_dladderror): New function to add a user + defined error message to the tables used by lt_dlerror(). + (lt_dlseterror): New function to allow setting of last_error by + user modules. + (ltdl_error_strings): New preprocessor generated table of internal + error diagnostic strings. + (user_error_strings): New internal list of registered user error + diagnostic strings. + (throughout!): Use error messages from ltdl_error_strings. + * libltdl/ltdl.h (ltdl_error_table): New macro to tabulate + internal diagnostic error strings alongside enum keys. + + * NEWS: Updated. + * doc/libtool.texi (Libltdl interface): Document new entry + points. + * libltdl/ltdl.c (lt_dltype_t): Use new type definitions for + existing fields. + (lt_dladdtype): New function to add a new ltdl dynamic loader + type to the end of the list of valid types.. + (lt_dlgettypes): New function to return the complete list of ltdl + dynamic loader types. + (lt_dlsettypes): New function to replace the list of ltdl dynamic + loader types entirely -- e.g. to prepend a new type to the + existing list. + (sys_dl_open, sys_dl_close, sys_dl_sym): Work with lt_syshandle. + (sys_shl_open, sys_shl_close, sys_shl_sym): ditto. + (sys_dld_open, sys_dld_close, sys_dld_sym): ditto. + (sys_wll_open, sys_wll_close, sys_wll_sym): ditto. + (sys_bedl_open, sys_bedl_close, sys_bedl_sym): ditto. + (presym_open, presym_close, presym_sym): ditto. + (tryall_dlopen): Call lt_lib_open_t functions lt_syshandle + compatibly. + (lt_dlclose): Call lt_lib_close_t functions lt_syshandle + compatibly. + (lt_dlsym): Call lt_find_sym_t functions lt_syshandle compatibly. + (lt_dltype_t): moved type declaration from here... + * libltdl/ltdl.h (lt_dltype_t): ...to here. + (lt_syshandle): new type for low level system handles passed by + loader functions + (lt_mod_init_t): New type for functions implementing the + initialisation for an ltdl dynamic loader. + (lt_mod_exit_t): Type of exit functions for the same. + (lt_lib_open_t): Type of loader functions for the same. + (lt_lib_close_t): Type of unloader functions for the same. + (lt_find_sym_t): Type of symbol resolver functions for the same. + + * libltdl/ltdl.c (sys_dl_init, sys_dl_exit, sys_dl_open, + sys_dl_close, sys_dl_sym): Preprocess these away on cygwin to + avoid spurious error messages. + +2000-01-24 Thomas Tanner + + fix severe bugs reported by Elrond + + * ltconfig.in: replace $objdir with $output_objdir + + * ltmain.in: change to the builddir before relinking programs + + * ltmain.in, ltconfig.in, libtool.m4, ltdl.m4: + remove unnessary spaces from line endings + +2000-01-19 Thomas Tanner + + * ltmain.in: rewrite of the ILD code, merge linking code for + programs, libraries and objects, allow linking of shared libraries + against static libraries/objects on platforms that support it + but print a warning, fix some typos + + * partially revert my previous change and + update only copyright notices of files that were actually modified + + * NEWS: update + + * libltdl/Makefile.am: version number was wrong + + * libltdl/ltdl.c (tryall_dlopen): revert Gary's change + since it breaks dlpreopening + * ltdl.m4: ditto + + * libltdl/ltdl.c (sys_search_path): search in the system default + library search path, too + * ltdl.m4 (AC_LTDL_SYSSEARCHPATH): extract the path + + * libltdl/ltdl.c (find_module): remove bogus file_not_found_error + + * libltdl/ltdl.c (load_deplibs): implement loading of dependency + libraries + * libltdl/ltdl.c (unload_deplibs): implement unloading of dependency + libraries + * libltdl/ltdl.c (lt_dlexit): correctly close all modules and + their dependencies + + * libltdl/ltdl.c (lt_dlforeach): new function + * libltdl/ltdl.h: ditto + * doc/libtool.texi (using libltdl): document it + + * libtool.m4: reformatting, only add -I$topsrc_dir/libltdl to + INCLTDL + + * libtoolize.in: reformatting + * ltconfig.in: reformatting + * ltmain.in: reformatting + + * mdemo/configure.in: AC_SUBST INCLTDL + * mdemo/Makefile.am: use INCLTDL + + * tests/Makefile.am: reexport OBJEXT and EXEEXT + * tests/dryrun.test: use them for building main.obj and mdemo.exe + +2000-01-17 Gary V. Vaughan + + * libltdl/ltdl.c (tryall_dlopen): Abort with + file_not_found_error before trying all lib_open() methods + if the file to be dlopened doesn't exist. + * ltdl.m4 (AC_HAVE_HEADERS): add unistd.h. + +2000-01-16 Gary V. Vaughan + + * libltdl/ltdl.c (find_file): memory error fixed. + +2000-01-14 Gary V. Vaughan + + * ltconfig.in (Usage): Now it matches the code! + Reported by Jon Leichter + + * README: Some notes about libtool release numbers. + + * mdemo/README: Explain the deliberate incompleteness of the + Windows port. + * mdemo/configure.in: Use AC_LIBTOOL_WIN32_DLL. + * mdemo/Makefile.am (LDFLAGS): Add -no-undefined. + + * libltdl/ltdl.h (LTDL_STMT_START, LTDL_STMT_END): Macros for + wrapping other macros to make a portable compound statement from + multiple C statements in the expansion. + (LTDL_SET_PRELOADED_SYMBOLS): Use the above macros to add an + extern declaration for lt_preloaded_symbols, to remove + dependency on undefined symbol from libltdl.dll on cygwin (and + other -no-undefined architectures). + * libltdl/ltdl.c (lt_preloaded_symbols): No longer defined here. + + * libtool,m4 (AC_LIBTOOL_SETUP): The result of lt_cv_need_dllmain + was set to the opposite of what it should be. + * configure.in (AC_LIBTOOL_WIN32_DLL): Call to this macro is + required for libtool configury to test lt_cv_need_dllmain on + Windows. + + * ltconfig.in (opt_cr, mingw*): replace unescaped ? with correctly + escaped and portable \{0,1\} in sed expression. + From Jon Leichter + +2000-01-13 Gary V. Vaughan + + * libtool.m4 (AC_LIBLTDL_CONVENIENCE): Add -I${top_srcdir}/libltdl + to default INCLTDL for VPATH. + (AC_LIBLTDL_INSTALLABLE): ditto. + Reported by Tom Tromey + +2000-01-12 Thomas Tanner + + * update all copyright notices to 2000 + + * doc/libtool.texi (using libltdl): document new lt_dlinfo struct, + replace NULL with @code{NULL}, document lt_dlsetdata(), + lt_dlgetdata() and lt_dlgetinfo() + * libltdl/Makefile.am: increment interface version number + * libltdl/configure.in: set version number to 1.1 + * libltdl/ltdl.c: make some variables public by moving them + to the info struct, add support for application specific data + within module handles, new lt_dlsetdata(), lt_dlgetdata() and + lt_dlgetinfo() functions, + fix memory leaks, minor cleanups + * libltdl/ltdl.h: ditto + * mdemo/main.c: demonstrate use of lt_dlgetinfo, + improved handling of errors + + * ltconfig.in: set hardcode_into_libs = yes for GNU/Hurd, Linux + and Solaris, only hardcode *all* run-paths if hardcode_into_libs + is set to 'all', otherwise hardcode only user-specified rpaths + into libraries + * ltmain.in: minor cleanups, we don't need to add user-specified + rpaths to compile_rpath, finalize_rpath is sufficient + + * ltconfig.in: transform linux* -> *linux-gnu* _after_ host_os has + been set! (reported by Bruno Haible ) + + * configure.in: AC_SUBST reload_flag, deplibs_check_method + and file_magic_cmd + + * README: use 'libtool --version' instead of 'ltconfig --version' + (suggested by Francios Pinard + +2000-01-10 Gary V. Vaughan + + * libltdl/ltdl.h (LTDL_DIRSEP_CHAR): Leave undefined when + not compiling for a Windows target. + * libltdl/ltdl.c (canonicalize_path): New function to + ensure internal paths use '/' directory separators. + (find_file): use canonicalize_path. Memory management + changed to cope. + (lt_dlopen): ditto. + (free_vars): Removed `dir' and `name', which are now handled + internally. + + * libltdl/ltdl.h (LTDL_DIRSEP_CHAR): Define to '/' or '\\', + as suitable for the target host. + (LTDL_PATHSEP_CHAR): Similarly with ':' or ';'. + * libltdl/ltdl.c: Use LTDL_DIRSEP_CHAR and LTDL_PATHSEP_CHAR + instead of hardcoding throughout. + Reported by Jon Leichter + +1999-12-18 Alexandre Oliva + + * ltmain.in: Oops, `largarg' -> `lastarg'. + + * ltmain.in (-Wc, -Xcompiler): Implemented in compile mode. + + * ltmain.in (-Xcompiler, -Xlinker): Add to compile_command and + finalize_command. + (-Wc, -Wl): Likewise. + + * tests/quote.test: Adjust quoting style of -Wl. + + * ltmain.in: Oops, `echo' -> `$echo'. + + * ltmain.in (-Wl, -Wc): Make commas argument separators, just like + in gcc. + + * ltmain.in (libtool_args): Get all arguments properly enclosed in + quotes and backslash-protected when needed. + +1999-12-16 Alexandre Oliva + + * ltdl.m4: Renamed from... + * libltdl/ltdl.m4: that no longer exists. + * configure.in (ACINCLUDE_M4_LIST): Removed libltdl/acinclude.m4. + * Makefile.am (aclocal_macros): Added ltdl.m4. + (libltdl/acinclude.m4): Concatenate libtool.m4 and ltdl.m4. + * bootstrap: Likewise. + * libltdl/Makefile.am (ACLOCAL): Remove the definition. Relying + upon -I may lead to duplicates. + * doc/libtool.texi: Suggest appending ltdl.m4 to acinclude.m4. + * libtoolize.in: Check AC_LIB_LTDL version number in aclocal.m4. + + * libltdl/configure.in (with_auxdir): Do not use it as the + argument of AC_CONFIG_AUX_DIR, automake requires a literal here. + Use AC_CONFIG_AUX_DIRS/DIR_DEFAULT instead. + + * libltdl/Makefile.am (ACLOCAL): Define with `-I .', as in + bootstrap. + +1999-12-15 Thomas Tanner + + * libltdl/configure.in: path to auxiliary files can be specified + using --with-auxdir (idea by Howard Chu ) + + * ltmain.in: don't remove multiple occurences from dependency_libs + of a library, otherwise many dependencies would get lost + + * bootstrap: use "aclocal -I ." instead of adding the contents + of ltdl.m4 to acinclude.m4 + +1999-12-13 Gary V. Vaughan + + * NEWS: updated. + * libltdl/Makefile.am: Use -no-undefined for dll compliance. + * libltdl/configure.in: Use AC_LIBTOOL_WIN32_DLL for dll + compliance. + * libltdl/ltdl.c: Define and use LTDL_GLOBAL_DATA to correctly + export global data symbols from libtldl.dll. + * libltdl/ltdl.h: Define and use LTDL_SCOPE to declare data + symbols as dllexport, dllimport or plain ornary extern depending + in the context in which it is used. + + * doc/libtool.texi (Distributing libltdl): document use of + ltdl.m4. + * libltdl/configure.in: Removed header checks, as they are + automatically performed by AC_LIB_LTDL. + * libltdl/ltdl.m4: Added header checks from configure.in, so that + AC_LIB_LTDL is sufficient to compile ltdl.c. + Reported by Stephan Kulow . + + * ltconfig.in (ltdll_obj): fixed typo: objdir -> $objdir + +1999-12-12 Gary V. Vaughan + + * ltconfig.in (cygwin*, mingw*, export_symbols_cmds): keep any + DATA tags associated with symbols by recent dlltool. + (cygwin*, mingw*, archive_expsym_cmds): Honor any DATA tags + found in the symbol list. + Reported by Jon Leichter . + +1999-12-10 Gary V. Vaughan + + From Stephan Kulow + * libltdl/ltdl.m4: Add arg 3 to AC_DEFINE's to save the user + from having to hack acconfig.h. + +1999-12-06 Gary V. Vaughan + + * NEWS: Updated. + * TODO: Note some cleanups that are now needed. + * libltdl/configure.in: Use the new macroised tests. + * libltdl/ltdl.m4: New file, macroised tests formerly in + libltdl/configure.in. + Reported by Stephan Kulow . + + From Tim Mooney + * ltconfig.in: split off the osf3 section, so that the osf4 and + osf5 sections can add `-msym' to arguments passed to the linker + for shared libs. + 1999-12-03 Alexandre Oliva * ltconfig.in (ac_compile): Use $ac_ext instead of .c. @@ -5,7 +1903,7 @@ (dlfcn.h, ac_try): Do not add filename, it is already in ac_compile. Reported by Stephane Conversy - + * ltconfig.in (linux-gnu*): Disable hardcode_into_libs until it works together with fast_install. @@ -23,13 +1921,13 @@ * ltconfig.in (linux-gnu*): Set hardcode_into_libs=yes. -1999-11-29 Gary V. Vaughan +1999-11-29 Gary V. Vaughan * ltconfig.in: Be friendlier to C++ compilers when testing for dlopen support. Reported by Stephan Kulow -1999-11-26 Gary V. Vaughan +1999-11-26 Gary V. Vaughan * libtool.m4: better use of $target instead of $host to support cross compilation. @@ -50,7 +1948,7 @@ * configure.in: Move ltconfig and ltmain.sh generation back... * Makefile.am: here. - + 1999-11-02 Thomas Tanner * NEWS: updated @@ -67,7 +1965,7 @@ * ltconfig.in: use old_deplibs for archives, too remove second occurence of sysv5 * ltmain.in: fix typo, fix the second occurence of -DPIC, too - + * libltdl/Makefile.am: increment version number, fix typo * libltdl/ltdl.c (lt_dlsym): don't report an error if the libltdl-style symbol name wasn't found @@ -76,7 +1974,7 @@ * ltconfig.in: add support for Unixware (sysv4.2uw2*) -1999-10-29 Gary V. Vaughan +1999-10-29 Gary V. Vaughan * ltmain.in: Damnit! Cygwin cvs committed all the dos line endings. @@ -106,13 +2004,13 @@ Support -mno-cygwin flag for building mingw32 dlls. * ltconfig.in (file_magic_cmd): add missing quotes. (deplibs_check_method): and here. - + 1999-10-16 Alexandre Oliva * libltdl/ltdl.c (lt_dlopen): Do not search paths when the specified library is not just a basename. -1999-10-10 Gary V. Vaughan +1999-10-10 Gary V. Vaughan * libtool.m4 (AC_PATH_FILE): new macro replaces AC_PATH_TOOL_GREP_OUTPUT. @@ -123,22 +2021,22 @@ * ltconfig.in (reload_flag): moved to libtool.m4. (deplbs_check_method): ditto. -1999-10-07 Gary V. Vaughan +1999-10-07 Gary V. Vaughan - * libtool.m4 (AC_PATH_PROG_VERSION_GREP): removed in favour of the + * libtool.m4 (AC_PATH_PROG_VERSION_GREP): removed in favour of the more general AC_PATH_PROG_GREP_OUTPUT. - (AC_PATH_TOOL_VERSION_GREP): removed in favour of the more general + (AC_PATH_TOOL_VERSION_GREP): removed in favour of the more general AC_PATH_TOOL_GREP_OUTPUT. (AC_PROG_LIBTOOL): Search for a working find program in the user's PATH using the new macros. - -1999-10-06 Gary V. Vaughan + +1999-10-06 Gary V. Vaughan * NEWS: updtaed. * ltconfig.in: Accept osf5. Reported by Sascha Schumann -1999-10-04 Gary V. Vaughan +1999-10-04 Gary V. Vaughan * ltmain.in (-no-install): This doesn't work on win32 since the search path for libraries is not encoded in the binary, @@ -148,7 +2046,7 @@ * ltmain.in (-no-fast-install): Wrapper script used to add the exeext on again when naming the wrapped executable. -1999-10-03 Gary V. Vaughan +1999-10-03 Gary V. Vaughan * ltconfig.in: Set $FILE to @FILE@ for substitution with the value found in libtool.m4 at configure time. @@ -182,10 +2080,10 @@ * libltdl/Makefile.am: don't preserve file attributes when installing the libltdl sources -1999-10-01 Gary V. Vaughan +1999-10-01 Gary V. Vaughan * configure.in (AC_OUTPUT_COMMANDS): generate ltmain.sh - * Makefile.am (ltmain.sh ltconfig): removed. Automake inserts the + * Makefile.am (ltmain.sh ltconfig): removed. Automake inserts the rules to automatically call config.status. * libtool.m4: be sure to AC_SUBST values no longer tested in @@ -194,13 +2092,13 @@ substitutions from config.status. * Makefile.am (ltconfig): generate ltconfig with config.status. * configure.in (AC_OUTPUT): generate ltconfig with config.status. - + 1999-09-30 Donald Anderson * ltconfig.in (sco3.2v5): use pass_all deplibs_check_method for SCO3.2. -1999-09-29 Gary V. Vaughan +1999-09-29 Gary V. Vaughan * ltconfig.in (whole-archive-flag-spec): I had been wondering why my file system was filling up with empty @@ -221,7 +2119,7 @@ * ltconfig.in (sysv5): Added support required for shared library linking on SCO UW7. -1999-09-22 Gary V. Vaughan +1999-09-22 Gary V. Vaughan * ltconfig.in (whole-archive-flag-spec): test whether the version of GNU ld being used understands --whole-archive @@ -238,7 +2136,7 @@ * ltmain.in (CDPATH): Likewise. Reported by Greg McGary -1999-08-24 Gary V. Vaughan +1999-08-24 Gary V. Vaughan * ltconfig.in (ltdll.c, impgen.c): Prevent the shell from expanding variables & backslash escapes when writing these @@ -264,7 +2162,7 @@ * doc/libtool.texi: document use of noinst_LTLIBRARIES for convenience libraries - + * ltconfig.in: check for freebsdelf3, not just freebsd3. Set hardcode_into_libs=yes for FreeBSD 3.0 and 3.1 @@ -279,7 +2177,7 @@ * libltdl/COPYING.LIB: Update to version 2.1. * libltdl/ltdl.h, libltdl/ltdl.c: Update FSF address. -1999-08-03 Gary V. Vaughan +1999-08-03 Gary V. Vaughan * libtool.m4 (mingw*, AC_PROG_LD): use tr for carriage return stripping. @@ -347,13 +2245,13 @@ called for code in the DLL. * ltmain.in (impgen.c): define O_BINARY to 0 if it is not in the system headers. - + 1999-07-24 Bert Driehuis * ltconfig.in: Updated bsdi4 soname specs to be more like linux as discussed on the bsdi mailing list. -1999-07-20 Gary V. Vaughan +1999-07-20 Gary V. Vaughan * configure.in (AC_PROG_RANLIB): No longer required as we now use AC_CHECK_TOOL in AC_LIBTOOL_SETUP. @@ -367,11 +2265,11 @@ to $host. * doc/libtool.texi (Invoking ltconfig): Document --build option. * NEWS: Note --build option. - + 1999-07-19 Erez Zadok - + * doc/PLATFORMS: Updated mostly *bsd platforms. - + 1999-07-19 Alexandre Oliva * doc/libtool.texi (Porting inter-library dependencies): Typos @@ -384,7 +2282,7 @@ * ltconfig.in: new pic_mode variable and --prefer[-non]-pic flags, fixed the strip check (reported by Keith Bostic ) * ltmain.in (compile mode): build only PIC/non-PIC code depending - on pic_mode + on pic_mode * libltdl/README: document the supported dlopen interfaces * doc/libtool.texi (tests): documented new tests * tests/Makefile.am: added new tests @@ -397,7 +2295,7 @@ * doc/libtool.texi (C++ Libraries): fixed a typo. -1999-07-06 Gary V. Vaughan +1999-07-06 Gary V. Vaughan * README-alpha: improved the release instructions to mention actual list addresses for announcements, and urls for upload @@ -412,7 +2310,7 @@ * ltconfig.in: finish_cmds for FreeBSD removed * depdemo/l3/Makefile.am: install libl3.la into an extra directory -1999-07-02 Gary V. Vaughan +1999-07-02 Gary V. Vaughan * configure.in: bumped version to 1.3c. @@ -472,7 +2370,7 @@ 1999-06-25 Alexandre Oliva * ltconfig.in (linux-gnu*, deplibs_check_method): Use pass_all on - alpha, x86 and sparc architectures by now, reverting to file_magic + alpha, x86 and sparc architectures by now, reverting to file_magic at least on ARM, where it breaks. 1999-06-23 Thomas Tanner @@ -482,18 +2380,18 @@ * doc/libtool.texi: document `-dlpreopen dummy' instead of `-dlopen dummy' * libltdl/ltdl.c (strchr): fixed typo (missing star) - + 1999-06-23 Stephan Kulow * libltdl/ltdl.c (strrchr): fixed typo (missing star) * libltdl/ltdl.c (trim): use `const' to silence -Wwrite-strings 1999-06-23 Olly Betts - + * ltmain.in (ltdll.c): Support for crosscompiling from linux to mingw32. -1999-06-23 Gary V. Vaughan +1999-06-23 Gary V. Vaughan * ltconfig.in (cygwin, export_symbols_cmds): If there is already an extracted and compiled ltdll.c, then don't delete, reextract @@ -503,7 +2401,7 @@ are paths through the code which run archive_expsym_cmds without running export_symbols_cmds. -1999-06-20 Gary V. Vaughan +1999-06-20 Gary V. Vaughan * ltconfig.in: moved the test for NM after the test for no_builtin_flag. @@ -512,7 +2410,7 @@ * ltconfig.in: Use sed '$q' instead of sed "" for copying ltmain, just in case some sed does not support an empty command. - + * ltconfig.in (link_static_flag, ac_cv_prog_cc_static): Use the latter in the test. @@ -531,13 +2429,13 @@ * ltconfig.in: CR/LF fix for broken DJGPP bash * ltmain.in: CR/LF fix for DJGPP -1999-06-18 Gary V. Vaughan +1999-06-18 Gary V. Vaughan * ltmain.in (outputname): When generating the executable wrapper script, $outputname already has the $exeext suffix, so we needn't add it again. -1999-06-16 Gary V. Vaughan +1999-06-16 Gary V. Vaughan * libltdl/configure.in (ac_cv_lib_dl_dlopen): missing "x" in test comparison corrected. @@ -551,7 +2449,7 @@ names passed without an extension, we now add a trailing `.' to prevent this from happening. -1999-06-15 Gary V. Vaughan +1999-06-15 Gary V. Vaughan * libltdl/ltdl.c (sys_wll_close): Strangely enough, Microsoft have decided that LoadLibrary returns `0' for success, yet FreeLibrary @@ -564,7 +2462,7 @@ 1999-06-12 Thomas Tanner - * ltmain.in: store old archives in deplibs and old_deplibs, + * ltmain.in: store old archives in deplibs and old_deplibs, retain the order of dependency libraries (even old archives), determining the absolute directory name didn't work due to a typo, add the library search paths of all dependency libraries when @@ -582,7 +2480,7 @@ * NEWS: Note work-around. Reported by Pavel Roskin -1999-06-09 Gary V. Vaughan +1999-06-09 Gary V. Vaughan * ltconfig.in (exeext): autoconf's AC_EXEEXT uses "no" to indicate no extension, and we must do the same in order to share the cache @@ -593,10 +2491,10 @@ 1999-06-09 Pavel Roskin - * ltconfig.in (exeext): Use quotes in the test, to prevent a + * ltconfig.in (exeext): Use quotes in the test, to prevent a failure in sh.test. -1999-06-09 Gary V. Vaughan +1999-06-09 Gary V. Vaughan * ltconfig.in: Reordered tests to be more like configure.in's recommended order (programs first, then libraries, etc.). @@ -615,7 +2513,7 @@ host. Also test that the compiler accepts the flag, and cache that result too. -1999-06-08 Gary V. Vaughan +1999-06-08 Gary V. Vaughan * ltconfig.in (LN_S): Accept, in order of decreasing preference: the cached value; an environment setting; ``ln -s'' if it works; @@ -677,7 +2575,7 @@ 1999-05-27 Alexandre Oliva , Olly Betts - * ltmain.in: Expand convenience libraries when creating reloadable + * ltmain.in: Expand convenience libraries when creating reloadable objects. * NEWS: Ditto. @@ -693,7 +2591,7 @@ * ltconfig.in (export_symbols_cmds): Add $convenience. (cygwin, export_symbols_cmds): Ditto. * ltmain.in: Generate export symbol list before expanding - convenience libraries, to avoid passing whole_archive_flag_spec to + convenience libraries, to avoid passing whole_archive_flag_spec to $NM. Reported by Godmar Back @@ -738,7 +2636,7 @@ 1999-05-24 Thomas Tanner - * NEWS: support for installing stripped libraries using GNU strip + * NEWS: support for installing stripped libraries using GNU strip * ltconfig.in: set deplibs_check_method=pass_all on FreeBSD, Linux and Solaris since no one can reproduce the famous deplibs bug @@ -755,7 +2653,7 @@ * ltmain.in: strip off the .exe suffix only on *Win (Reported by Matthew D. Langston ) - + 1999-05-22 Thomas Tanner * NEWS: updated @@ -769,7 +2667,7 @@ * ltconfig.in: linkopts -> compiler_flags for $CC and linker_flags for $LD, link_all_deplibs=yes on IRIX -1999-05-22 Gary V. Vaughan +1999-05-22 Gary V. Vaughan * NEWS: insert todays date alongside 1.3.1 release. * Makefile.in: use gnu not gnits rules @@ -782,7 +2680,7 @@ * libltdl/configure.in (dlerror): Fix typo in dlopen found in -ldl test. -1999-05-21 Pavel Roskin +1999-05-21 Pavel Roskin * Makefile.am (EXTRA_DIST): Don't distribute instutils. (install-data-hook): use libltdl/Makefile.am's local-install files @@ -796,7 +2694,7 @@ * doc/PLATFORMS: Updated to 1.3.1 for all platforms I've got. Added sparc-unknown-linux-gnu. -1999-05-21 Gary V. Vaughan +1999-05-21 Gary V. Vaughan * demo/foo.h: s/PARAMS/LTDL_PARAMS/g * libltdl/ltdl.h: ditto. @@ -812,7 +2710,7 @@ * NEWS: Updated docs. * TODO: Recommend libtool.m4 to be inserted in acinclude.m4. AIX 4.3.2.0 no longer fails on static dlopening. GNU DLD no longer - has to support .la files, since libltdl already does. Convenience + has to support .la files, since libltdl already does. Convenience libraries and reloadable objects should be tested in the testsuite. We could support some amount of control on the soname of libraries. @@ -830,31 +2728,31 @@ * libtool.m4 (AC_LIBLTDL_*): set INCLTDL to the path of ltdl.h * ltconfig.in: check for dlopen with -ldl first -1999-05-19 Gary V. Vaughan +1999-05-19 Gary V. Vaughan * NEWS: Added 1.3.1 news items. * doc/PLATFORMS: updated the boxes I have access to, to 1.3.1 in preparation for the next release. -1999-05-18 Gary V. Vaughan +1999-05-18 Gary V. Vaughan * ltconfig.in (cygwin*, whole_archive_flag_spec): dlltool chokes on this, so leave it unset in this case so that the ltmain code knows it has to unpack convenience archives by itself. -1999-05-17 Gary V. Vaughan +1999-05-17 Gary V. Vaughan * ltmain.in: Do not exit when an unknown library name is passed passed in, simply warn and continue since some compilers require -LANG:* like options to work. Reported by Adam C. Powell, IV - + 1999-05-17 Jiro Takabatake - + * ltconfig.in: port to NEC UX/4800. * NEWS: updated. - -1999-05-17 Gary V. Vaughan + +1999-05-17 Gary V. Vaughan * ltconfig.in (beos*, deplibs_check_method): set to pass_all. BeOS is PIC by default. @@ -862,7 +2760,7 @@ * libltdl/configure.in: Fix test failures on AIX 4.3.2 by checking for dlopen *with* -ldl first. - Reported by Greg Wooledge + Reported by Greg Wooledge * demo/foo.h: Don't set any declspecs until we have full dll support. @@ -882,11 +2780,11 @@ (instal-data-hook): Add srcdir/instutil to the beginning of the PATH before installing libltdl's sources. -1999-05-09 Gary V. Vaughan +1999-05-09 Gary V. Vaughan * TODO: updated. -1999-05-06 Gary V. Vaughan +1999-05-06 Gary V. Vaughan * Makefile.am (install-data-hook): make sure the install directory is not left world writable. @@ -906,7 +2804,7 @@ * ltmain.in: Save exit status of link_command before removing symbol table object file. -1999-04-29 Gary V. Vaughan +1999-04-29 Gary V. Vaughan * doc/PLATFORMS: updated my hpux-10.20 and cygwin box entries. @@ -931,11 +2829,11 @@ * libltdl/acconfig.h: New file. Add #undefs for defines that would be duplicated. -1999-04-29 Gary V. Vaughan +1999-04-29 Gary V. Vaughan * libtool.m4 (cygwin*|mingw*, DLLTOOL, OBJDUMP, AS): Only expand the code that makes these configure time checks on hosts that need the - tools *and* if the AC_LIBTOOL_WIN32_DLL macro is used. + tools *and* if the AC_LIBTOOL_WIN32_DLL macro is used. 1999-04-29 Alexandre Oliva @@ -953,7 +2851,7 @@ (AC_LIBLTDL_CONVENIENCE, AC_LIBLTDL_INSTALLABLE): Fix calls to AC_BEFORE. -1999-04-28 Gary V. Vaughan +1999-04-28 Gary V. Vaughan * libtool.m4 (ltconfig_enable_win32_dll): pass --enable-win32-dll to ltconfig if this is set. @@ -993,11 +2891,11 @@ don't add a statically linked library to the dependency_libs * ltmain.in (help uninstall): added a missing backslash after echo (reported by Ossama Othman) - + 1999-04-27 Alexandre Oliva * ltmain.in (old_archive_cmds): Iterate on oldobjs to find out - which links to object files we must create. Do not test for empty + which links to object files we must create. Do not test for empty pic_flag to create such links. Use objext when searching for object files extracted from convenience library. @@ -1005,7 +2903,7 @@ create temporaries in the current directory when output should go elsewhere. We must perform locking if it does. -1999-04-27 Gary V. Vaughan +1999-04-27 Gary V. Vaughan * ltmain.in (old_archive_cmds): Ensure that there are always .o objects available before running old_archive_cmds. @@ -1016,7 +2914,7 @@ 1999-04-26 Alexandre Oliva - * ltconfig.in (aix4.[01], always_export_symbols): The case pattern + * ltconfig.in (aix4.[01], always_export_symbols): The case pattern would never match; fixed. Reported by Stephan Kulow @@ -1073,7 +2971,7 @@ * ltconfig.in (irix*, soname_spec): Append $major. (irix*, library_names_spec): Add new soname. Reported by David Kaelbling - + * ltconfig.in (irix*, sys_lib_dlsearch_path_spec): /usr/local/lib is not searched by default. /usr/lib is searched before /lib. * ltconfig.in (irix*, sys_lib_search_path_spec): /usr/lib is @@ -1176,7 +3074,7 @@ * dryrun.test: It would still fail at random times, because `cp' and `mv' are not guaranteed to preserve the timestamps of the installed files. Instead of preserving them, just remove them - before the dry uninstall test. Redirect dry-run output to stderr, + before the dry uninstall test. Redirect dry-run output to stderr, so that it can be easily separated from the regular output. 1999-04-07 Thomas Tanner @@ -1196,7 +3094,7 @@ * tests/dryrun.test: The constant modifications of libtool would cause main.o to be updated at the wrong time; the new approach is to modify the libtool script so that it enables dry run depending - on whether an environment variable is set or not. I've also moved + on whether an environment variable is set or not. I've also moved `after' and `before' to a directory deep within $objdir, instead of creating it in ../tests. * tests/Makefile.am (CLEANFILES): Removed. @@ -1213,8 +3111,8 @@ * tests/dryrun.test: Use cmp instead of diff. (before, after): Create them within ../tests. - (libtool): Set to `/bin/sh ./libtool' by default, but use LIBTOOL, - SHELL and top_builddir from the environment if available. For dry + (libtool): Set to `/bin/sh ./libtool' by default, but use LIBTOOL, + SHELL and top_builddir from the environment if available. For dry runs, use "$libtool -n". * tests/Makefile.am (CLEANFILES): Added before and after. * ltmain.in: Do not create links to object files in dry runs. @@ -1271,8 +3169,8 @@ * ltconfig.in: if ld_shlibs=no, set can_build_shared=no too, otherwise it will just be disregarded. This would cause - netbsd/m68k with GNU ld a.out, and certainly many other platforms, - to incorrectly believe that shared libraries were supported, while + netbsd/m68k with GNU ld a.out, and certainly many other platforms, + to incorrectly believe that shared libraries were supported, while archive_cmds was empty, causing shared libraries not to be created 1999-04-03 Alexandre Oliva @@ -1288,12 +3186,12 @@ 1999-04-02 Alexandre Oliva - * ltmain.in (convenience): fixed race condition when more than one + * ltmain.in (convenience): fixed race condition when more than one library was linked with the same convenience library by uniquifying the extract directory. It is now named after the new library *and* the old one, and lives in the objdir of the new one. - * ltmain.in (-L*): do not abort just because a directory specified + * ltmain.in (-L*): do not abort just because a directory specified with -L does not exist; just warn and discard it * depdemo/l1/Makefile.am (AUTOMAKE_OPTIONS): no-dependencies @@ -1306,7 +3204,7 @@ * demo/Makefile.am (CLEANFILES): clean EXTRA_* from deplibs-check - * libtool.m4 (LDFLAGS, LIBS): pass them to ltconfig, for the tests + * libtool.m4 (LDFLAGS, LIBS): pass them to ltconfig, for the tests that involve linking * Makefile.am (LDFLAGS, LIBS, libtool, clibtool): ditto * tests/Makefile.am (CFLAGS, CPPFLAGS, LDFLAGS, LIBS): set @@ -1343,7 +3241,7 @@ * ltmain.in: always link a library before its dependency libs * mdemo/Makefile.am: test -export-symbols-regex - + 1999-03-30 Thomas Tanner * doc/libtool.texi: fixed a typo @@ -1362,7 +3260,7 @@ and add them to dependency_libs, add -lc before deplibs, always link all dependencies of a static library or if link_all_deplibs is yes, hardcode library paths if - hardcode_into_libs is no, don't link against dependency_libs + hardcode_into_libs is no, don't link against dependency_libs that already are deplibs 1999-03-30 Alexandre Oliva @@ -1376,7 +3274,7 @@ library search path * ltmain.in, ltconfig.in: reverted most of the quoting changes - from 1999-03-25; Gary's delay_variable_subst patch from 1999-02-19 + from 1999-03-25; Gary's delay_variable_subst patch from 1999-02-19 obviates it. Keep only quoting of $PATH, for uniformity with other systems that already did it @@ -1386,7 +3284,7 @@ extra byte of memory for the teminating NUL, and forgot to strcpy the original path in to the new memory before appending the new path compononent. - + 1999-03-27 Thomas Tanner * NEWS: updated @@ -1416,18 +3314,18 @@ * tests/demo-exec.test, tests/demo-inst.test: run the new program * ltconfig.in (irix5*, irix6*, deplibs_check_method): pass_all - * ltmain.in ($PATH): instead of modifying the PATH, better prevent - its expansion the first time *_cmds variables are eval'ed. Modify + * ltmain.in ($PATH): instead of modifying the PATH, better prevent + its expansion the first time *_cmds variables are eval'ed. Modify $show within loops that eval them so as to expand variables * ltconfig.in (*_cmds): quote $ so that they're not expanded by the first eval -1999-03-25 Gary V. Vaughan +1999-03-25 Gary V. Vaughan * ltmain.in ($PATH): Expand any tildes in the users path to the contents of $HOME to avoid problems with *_cmds splitting and evaluation. - + 1999-03-24 Thomas Tanner * TODO: support -dlopen for libraries @@ -1446,7 +3344,7 @@ * ltconfig.in (ld_shlibs, amigaos*): disable shared libraries -1999-03-23 Gary V. Vaughan +1999-03-23 Gary V. Vaughan * libltdl/configure.in: the sed expression for finding the shared library extension used to think the . in [.] for the cygwin @@ -1459,7 +3357,7 @@ 1999-03-21 Alexandre Oliva - * tests/build-relink.test: if we relink and have hardcode_direct, + * tests/build-relink.test: if we relink and have hardcode_direct, removing an uninstalled library breaks an uninstalled program * doc/libtool.texi: documented convenience libraries @@ -1503,7 +3401,7 @@ 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 + * ltmain.in: fix sourcing of .la files on Solaris (patch by Raja R Harinath) 1999-03-19 Alexandre Oliva @@ -1542,7 +3440,7 @@ * tests/Makefile.am (TESTS): added noinst-link.test * doc/libtool.texi: document it -1999-03-19 Gary V. Vaughan +1999-03-19 Gary V. Vaughan * ltmain.in (dependency_libs): There is no reason to infer that the pseudo library is invalid if dependency_libs='' at @@ -1563,14 +3461,14 @@ arguments in libtool_args, accept relative -L directories, ignore -lm on BeOS and Cygwin, always ignore -lc, handle -l, -L and .la arguments later, always make the library - installation directory (-rpath) absolute, in relink mode don't + installation directory (-rpath) absolute, in relink mode don't delete the not-relinked library and exit immediately after relinking, try to find already-installed libtool libraries that were specified using -l, support hardcoding of library paths into libraries too, export shlibpath before linking libraries, and a lot of other big changes that I don't want to describe here... please read the source. - + * merged Gary's Win32 code from the ILD branch: * NEWS: Win32 DLLs are now supported * TODO: removed .a library namespace clash for win32. It is @@ -1598,8 +3496,8 @@ -lm, and although the linker fakes having one, specifiying it to libtool will break ILD, so we ignore it when generating dependencies. - -1999-03-17 Gary V. Vaughan + +1999-03-17 Gary V. Vaughan * doc/PLATFORMS: Thanks to Alexandres changes below, both my hp boxes pass the entire test suite. @@ -1637,5 +3535,3 @@ * ltmain.in: ditto Continued in ChangeLog.0 - - $Revision$ $Date$ diff --git a/Makefile.am b/Makefile.am index c31ab2798..27be8a0da 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,16 +6,21 @@ BUILD_SUBDIRS = . libltdl doc tests SUBDIRS = $(BUILD_SUBDIRS) DIST_SUBDIRS = $(BUILD_SUBDIRS) $(CONF_SUBDIRS) +# We need to export these variables +CFLAGS = @CFLAGS@ +CPPLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS= @LIBS@ + aclocal_macros = libtool.m4 ltdl.m4 -EXTRA_DIST = $(aclocal_macros) bootstrap libtoolize.in ltconfig.in \ - ltmain.in ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh \ +EXTRA_DIST = $(aclocal_macros) bootstrap libtoolize.in ltmain.in \ mkstamp ChangeLog.0 ChangeLog.1 -CLEANFILES = libtool libtoolize ltconfig.T ltmain.shT +CLEANFILES = libtool libtoolize ltmain.shT # These are required by libtoolize. -pkgdata_SCRIPTS = config.guess config.sub ltconfig -pkgdata_DATA = ltmain.sh ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh +pkgdata_SCRIPTS = config.guess config.sub +pkgdata_DATA = ltmain.sh # This macro file should be visible to Automake's aclocal. aclocal_DATA = $(aclocal_macros) @@ -23,74 +28,21 @@ aclocal_DATA = $(aclocal_macros) # The standalone libtool script, and the libtool distributor. bin_SCRIPTS = libtool libtoolize -# We have to define these explicitly because we do not use the -# libtool macros that would define them. -if HAVE_CXX -LIBTOOL_CXX_DEPS = $(srcdir)/ltcf-cxx.sh -endif -if HAVE_GCJ -LIBTOOL_GCJ_DEPS = $(srcdir)/ltcf-gcj.sh -endif -LIBTOOL_DEPS = $(srcdir)/ltmain.sh $(srcdir)/ltconfig \ - $(srcdir)/ltcf-c.sh $(LIBTOOL_CXX_DEPS) $(LIBTOOL_GCJ_DEPS) - -libtool: $(LIBTOOL_DEPS) - -rm -f $@T - AR="$(AR)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \ - LTCC="$(CC)" FILE="$(FILE)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \ - LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \ - STRIP="$(STRIP)" AS="$(AS)" DLLTOOL="$(DLLTOOL)" \ - OBJDUMP="$(OBJDUMP)" \ - objext="$(OBJEXT)" exeext="$(EXEEXT)" \ - reload_flag="$(reload_flag)" \ - deplibs_check_method="$(deplibs_check_method)" \ - file_magic_cmd="$(file_magic_cmd)" \ - $(SHELL) $(srcdir)/ltconfig $(LIBTOOL_FLAGS) --srcdir=$(srcdir) \ - --output=$@T $(srcdir)/ltmain.sh $(host_triplet) -if HAVE_CXX - AR="$(AR)" CC="$(CXX)" CFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" \ - LTCC="$(CC)" FILE="$(FILE)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \ - LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \ - STRIP="$(STRIP)" AS="$(AS)" DLLTOOL="$(DLLTOOL)" \ - OBJDUMP="$(OBJDUMP)" \ - objext="$(OBJEXT)" exeext="$(EXEEXT)" \ - reload_flag="$(reload_flag)" \ - deplibs_check_method="$(deplibs_check_method)" \ - file_magic_cmd="$(file_magic_cmd)" \ - $(SHELL) $(srcdir)/ltconfig $(LIBTOOL_FLAGS) --srcdir=$(srcdir) \ - --add-tag=CXX --output=$@T $(srcdir)/ltcf-cxx.sh $(host_triplet) -endif -if HAVE_GCJ - AR="$(AR)" CC="$(GCJ)" CFLAGS="$(GCJFLAGS)" CPPFLAGS="$(CPPFLAGS)" \ - LTCC="$(CC)" FILE="$(FILE)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \ - LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \ - STRIP="$(STRIP)" AS="$(AS)" DLLTOOL="$(DLLTOOL)" \ - OBJDUMP="$(OBJDUMP)" \ - objext="$(OBJEXT)" exeext="$(EXEEXT)" \ - reload_flag="$(reload_flag)" \ - deplibs_check_method="$(deplibs_check_method)" \ - file_magic_cmd="$(file_magic_cmd)" \ - $(SHELL) $(srcdir)/ltconfig $(LIBTOOL_FLAGS) --srcdir=$(srcdir) \ - --add-tag=GCJ --output=$@T $(srcdir)/ltcf-gcj.sh $(host_triplet) -endif - -rm -f $@ - mv $@T $@ - -# Experimental C version of libtool. -clibtool: $(srcdir)/ltmain.c $(srcdir)/ltconfig - AR="$(AR)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \ - LTCC="$(CC)" FILE="$(FILE)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \ - LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \ - STRIP="$(STRIP)" AS="$(AS)" DLLTOOL="$(DLLTOOL)" \ - OBJDUMP="$(OBJDUMP)" \ - objext="$(objext)" exeext="$(exeext)" reload_flag="$(reload_flag)" \ - deplibs_check_method="$(deplibs_check_method)" file_magic_cmd="$(file_magic_cmd)" \ - $(SHELL) $(srcdir)/ltconfig $(LIBTOOL_FLAGS) --srcdir=$(srcdir) \ - --output=$@ $(srcdir)/ltmain.c $(host_triplet) +libtool: $(srcdir)/ltmain.sh $(top_builddir)/configure.ac + $(SHELL) $(top_builddir)/config.status --recheck + chmod +x $@ libtoolize: $(srcdir)/libtoolize.in $(top_builddir)/config.status - CONFIG_FILES=libtoolize CONFIG_HEADERS= $(top_builddir)/config.status - chmod +x libtoolize + CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) $(top_builddir)/config.status + chmod +x $@ + +$(srcdir)/ltmain.sh: $(srcdir)/ltmain.in $(TSDEPS) + -rm -f ltmain.shT + date=`$(SHELL) $(srcdir)/mkstamp < $(srcdir)/ChangeLog` && \ + sed -e 's/@''PACKAGE@/@PACKAGE@/' -e 's/@''VERSION@/@VERSION@/' \ + -e "s%@""TIMESTAMP@%$$date%" $(srcdir)/ltmain.in > ltmain.shT + mv -f ltmain.shT $@ || \ + (rm -f $@ && cp ltmain.shT $@ && rm -f ltmain.shT) # TSDEPS will be defined to TSDEPS_DIST at `make dist' time TSDEPS = @@ -103,29 +55,6 @@ update-timestamps: @if (cd $(srcdir) && test -d CVS && \ $(CVS) -n update $(TSDEPS_DIST) | grep '^M'); then \ echo "Cannot make dist before commit"; exit 1; else :; fi - $(MAKE) TSDEPS="$(TSDEPS_DIST)" $(srcdir)/ltconfig $(srcdir)/ltmain.sh - -# Do line number substitution, as well as PACKAGE, VERSION and TIMESTAMP. -# Line numbering transliterated from a section in autoconf (Autoconf 2.12). -@srcdir@/ltconfig: $(srcdir)/ltconfig.in $(top_srcdir)/configure.in $(TSDEPS) - rm -f ltconfig.T - date=`$(SHELL) $(srcdir)/mkstamp < $(srcdir)/ChangeLog` && \ - $(AWK) '/@LINENO@/ { printf "%d:", NR } { print }' $(srcdir)/ltconfig.in | \ - sed -e 's/@''PACKAGE@/@PACKAGE@/' -e 's/@''VERSION@/@VERSION@/' \ - -e "s%@""TIMESTAMP@%$$date%" \ - -e '/@LINENO@/s/^\([0-9][0-9]*\):\(.*\)@LINENO@/\2\1/' \ - > ltconfig.T - chmod +x ltconfig.T - mv -f ltconfig.T $@ || \ - (rm -f $@ && cp ltconfig.T $@ && rm -f ltconfig.T) - -@srcdir@/ltmain.sh: $(srcdir)/ltmain.in $(top_srcdir)/configure.in $(TSDEPS) - -rm -f ltmain.shT - date=`$(SHELL) $(srcdir)/mkstamp < $(srcdir)/ChangeLog` && \ - sed -e 's/@''PACKAGE@/@PACKAGE@/' -e 's/@''VERSION@/@VERSION@/' \ - -e "s%@""TIMESTAMP@%$$date%" $(srcdir)/ltmain.in > ltmain.shT - mv -f ltmain.shT $@ || \ - (rm -f $@ && cp ltmain.shT $@ && rm -f ltmain.shT) # All our rules should depend on these demo files. all-recursive: $(srcdir)/libltdl/acinclude.m4 $(ACINCLUDE_M4_LIST) diff --git a/NEWS b/NEWS index 8df67c7e7..38125a6d3 100644 --- a/NEWS +++ b/NEWS @@ -1,8 +1,40 @@ NEWS - list of user-visible changes between releases of GNU Libtool -New in 1.4b: 2001-??-??; CVS version 1.4a, Libtool team: +New in 1.4d: 2002-01-07; CVS version 1.4c, Libtool team: +* Help strings display correctly again. +* Better error messages when library linking fails. +* Better error messages from libltdl when loading fails. +* Better search path management in libltdl with `lt_dlinsertsearchdir' call. +* Support /lib/w32api in recent cygwin releases. +* Support cross compilation to mingw. +* Support for .rc files (Windows resource compiler). +* Improved handling of mingw gcc. +* Improved handling of $PATH with entries containing spaces. +* Improved support for linking with gcc on aix4* and aix5*. +* Improved support for GCC 3.0. +* Initial support for QNX RTOS, UnixWare 7 and OpenUNIX 8. +* Bug fixes to the OpenBSD port. +* Bug fixes. + +New in 1.4b: 2001-07-09; CVS version 1.4a, Libtool team: +* Now bootstraps with autoconf-2.50 and automake-1.4-p4. +* Always try to build at least a static lib, even if both static and + shared libs were disabled. * Full support for C++ compiler. * Support for GNU gcj compiler. +* libltdl can now load all modules in a given path according to user + supplied criteria with `lt_dlforeachfile' call. +* Improved support for AIX ia64, djgpp, HPUX, hurd, OpenBSD, sco3.2*. +* Internal mutex handling no longer has namespace clashes on NCR MP-RAS. +* New pdemo and tagdemo tests. +* Bug fixes. + +New in 1.4.1: 2001-??-??; CVS version 1.4.0a, Libtool team: +* Don't leave here-doc files behind. + +New in 1.4: 2001-04-25; CVS version 1.3e, Libtool team: +* Support for aix5*. +* Bugfixes. New in 1.3d: 2001-04-02; CVS version 1.3c, Libtool team: * ltconfig is no more. Generation of libtool happens directly from @@ -63,6 +95,7 @@ New in 1.3.5: 2000-05-27, CVS version 1.3.4a, Libtool team: New in 1.3.4: 1999-12-08, CVS version 1.3.3a, Libtool team: * Support for Compaq Tru64 V5.0. +* Improved support for Digital Unix V4.*. * Improved support for NetBSD, FreeBSD and Unixware. * Many fine bugfixes. diff --git a/README b/README index c41e1f7cf..6bba84915 100644 --- a/README +++ b/README @@ -2,6 +2,14 @@ This is GNU Libtool, a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface. +IMPORTANT: +========== + +** Until the next release of automake, you should apply the patch at ** +** the end of this file to your installed automake script if you ** +** intend to use it in conjunction with this release of libtool. ** + + To use libtool, add the new generic library building commands to your Makefile, Makefile.in, or Makefile.am. See the documentation for details. @@ -25,6 +33,7 @@ Shared library support has been implemented for these platforms: NetBSD 1.x (*-*-netbsd*) OpenBSD 2.x (*-*-openbsd*) OS/2 using EMX (*-*-os2*) + Reliant Unix (*-sni-sysv4) [see note] SCO OpenServer 5.x (*-*-sco3.2v5*) SCO UnixWare 7.x (*-*-sysv5*) Solaris 2.x (*-*-solaris2*) @@ -48,6 +57,14 @@ You can only use gcc. This bug will hopefully be fixed in autoconf 2.14. NOTE: Any earlier DG/UX system with ELF executables, such as R3.10 or R4.10, is also likely to work, but hasn't been explicitly tested. +NOTE: Libtool has only been tested with the Siemens C-compiler and +an old version of gcc provided by Marco Walther you can find on +ftp://ftp.mch.sni.de/sni/mr/pd/gnu/gcc/gcc.2.7.2.3 on Reliant Unix. + +NOTE: libtool.m4, ltdl.m4 and the configure.ac files are marked to use +autoconf-mode, which is distributed with GNU Emacs 21, and all recent +releases of XEmacs. + Libtool's home page is: http://www.gnu.org/software/libtool/libtool.html @@ -65,4 +82,67 @@ If you have any suggestions or bug reports, or you wish to port libtool to a new platform, please send electronic mail to the libtool mailing list or bug reports to . Don't forget to mention the version of libtool that you are currently -using (by typing `ltconfig --version'). +using (by typing `libtool --version'). + +People have complained that they find the version numbering scheme +under which libtool is released confusing... it works like this: + + . + +Releases with a less than 1 were not yet feature +complete. If libtool ever undergoes a major rewrite or substantial +restructuring, the will be incremented again. In the +mean time, whenever we make a stable release it will have its + incremented with respect to the previous stable +release. + +So that alpha releases can be distinguished from stable releases, +we append a letter to them, starting with `a' and continuing +alphabetically: + + . + +Since alpha releases are start with the code of a previous stable +release, the and are the same as the +stable release they started with. So release `1.3a' is the first +alpha release after stable release `1.3', and so on. + +To complicate matters slightly we always increment the letter in the +repository before *and* after making a release tarball. This means +that "odd" letters (a,c,e,g...) only exist in the repository, and +"even" letters are used instantaneously for an alpha release. For +example, you can tell that libtool-1.3c is an alpha release that is a +snapshot of the repository taken between official alpha releases +1.3b and 1.3d. Since the odd lettered alpha release number potentially +cover many states of the tree, we somtimes qualify such releases by +adding the cvs version of the ChangeLog: + + $ libtool --version + ltmain.sh (GNU libtool) 1.3c (1.666 2000/01/14 13:50:21) + +Finally, if we need to make a patch release to fix bugs in a stable +release, and the development on the trunk has made the tree unstable, +we use a third number, so: + + .. + + $ libtool --version + ltconfig (GNU libtool) 1.3.4 (1.385.2.196 1999/12/07 21:47:57) + +There might be several patch releases to the last stable release, +and all happening concurrently with alpha releases. For example, +libtool-1.3.4 and libtool-1.3b might be available at the same time: +`1.3.4' is the fourth patch release after stable release `1.3'; +`1.3b' is the first alpha release after stable release `1.3'. + +--- /usr/bin/automake Sat Mar 11 09:25:33 2000 ++++ automake Thu Sep 7 22:08:33 2000 +@@ -187,7 +187,7 @@ $seen_libtool = 0; + $libtool_line = 0; + + # Files installed by libtoolize. +-@libtoolize_files = ('ltconfig', 'ltmain.sh', 'config.guess', 'config.sub'); ++@libtoolize_files = ('ltmain.sh', 'config.guess', 'config.sub'); + + # TRUE if we've seen AM_MAINTAINER_MODE. + $seen_maint_mode = 0; diff --git a/README-alpha b/README-alpha index 857b1829a..2d4009d4b 100644 --- a/README-alpha +++ b/README-alpha @@ -53,11 +53,12 @@ using (by typing `ltconfig --version'). * Fetch new versions of the files that are maintained by the FSF. config.guess and config.sub are available via ftp from - ftp://ftp.gnu.org/gnu/config/ + ftp://ftp.gnu.org/gnu/config/, and texinfo.tex is available from + ftp://ftp.gnu.org/gnu/GNUinfo/. * Update NEWS. -* Update the version number in configure.in. +* Update the version number in configure.ac. (The idea is that every other alpha number will be a net release. The repository will always have its own "odd" number so we can easily distinguish net and repo versions.) @@ -79,13 +80,13 @@ using (by typing `ltconfig --version'). libtool--.tar.xdp.gz' * Upload release tarball, diff file and xdelta file - ftp://melange.gnu.org/~ftp/gnu/libtool and send announcement to + ftp://fencepost.gnu.org/~ftp/gnu/libtool and send announcement to libtool@gnu.org. * If not an alpha, announcement must also go to info-gnu@gnu.org, and an upload request be sent to ftp-upload@gnu.org requesting files be transferred from ftp://alpha.gnu.org/gnu/libtool to ftp://ftp.gnu.org/gnu/libtool. -* Update version number in configure.in to next alpha number. +* Update version number in configure.ac to next alpha number. * Commit. diff --git a/THANKS b/THANKS index 4d37b022b..f16b81725 100644 --- a/THANKS +++ b/THANKS @@ -11,6 +11,7 @@ time and energy in helping to track down bugs, port to new systems, and generally assist in the libtool maintainership process: Akim Demaille +Albert Chin-A-Young Andrey Slepuhin Art Pope Bruno Haible diff --git a/TODO b/TODO index a7b073af3..2fab33a80 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,13 @@ In the near future: ******************** +* Figure out why zsh echo builtin's removal of \ escapes is not detected + by libtool's echo selector. + +* Port the migration of all code from ltconfig into libtool.m4 to the +multi-language-branch, so that CVS automake can remove its references +to ltconfig. + * Fix the following bugs in libltdl: - error reporting of tryall_dlopen(): if the file actually doesn't exist (stat() fails or it wasn't dlpreopened) @@ -50,6 +57,13 @@ files that get installed. In the future: ************** +* The definitions for AC_LTDL_SHLIBEXT, AC_LTDL_SHLIBPATH and +AC_LTDL_SYSSEARCHPATH should not rely on the _LT_AC_LTCONFIG_HACK +macro. This involves moving the code which sets the variables +library_names_spec, shlibpath_var and sys_lib_dlsearch_path_spec from +into a separate macro, and AC_REQUIRING the newly extracted macro in the +respective ltdl.m4 macros. + * Godmar Back writes: libltdl uses such stdio functions as fopen, fgets, feof, fclose, and others. These functions are not async-signal-safe. While this does not make @@ -66,11 +80,6 @@ In the future: possible would greatly improve libltdl's ability to be embedded in and used by other systems. -* Support -dlopen/dlpreopen for libraries. - This requires adding two new variables (dlopen/dlpreopen) to - the pseudo-library and later dlopening them when a program is linked - against such a library. - * Arrange that EXEEXT suffixes are stripped from wrapper script names only when needed, and that a timestamp file or a wrapper program is created with the EXEEXT suffix, so that `make' doesn't build it every @@ -142,6 +151,9 @@ the same version number, but depending on different versions of libc, for example. In the future, we might even have an option to encode the sonames of all dependencies of a library into its soname. +* The current implementation of libltdl in a subdirectory doesn't work +properly with AC_CONFIG_AUX_DIR using projects. + Things to think about: ********************** @@ -155,3 +167,10 @@ like libtool should be distributed as part of such a binary package. * Maybe implement full support for other orthogonal library types (libhello_g, libhello_p, 64 vs 32-bit ABI's, etc). Make these types configurable. + +* Perhaps the iuse of libltdl could be made cleaner by allowing +registration of hook functions to call at various points. This would +hopefully free the user from having to maintain a parallel module +list with user data. This would likely involve being able to carry +additional per user module data in the lt_dlmodule structure -- perhaps +in the form of an associative array keyed by user name? diff --git a/bootstrap b/bootstrap index 7150557ca..7304e8f92 100755 --- a/bootstrap +++ b/bootstrap @@ -1,35 +1,51 @@ #! /bin/sh # helps bootstrapping libtool, when checked out from CVS -# requires GNU autoconf and GNU automake +# requires at least GNU autoconf 2.50 and GNU automake1.4-p5 + +find . \( -name autom4te.cache -o -name libtool \) -exec rm -r {} \; : ${ACLOCAL=aclocal} : ${AUTOMAKE=automake} : ${AUTOCONF=autoconf} : ${AUTOHEADER=autoheader} -rm -f acinclude.m4 -ln -s libtool.m4 acinclude.m4 # fake the libtool scripts -touch ltconfig touch ltmain.sh touch libtoolize -${ACLOCAL} -${AUTOMAKE} --gnu --add-missing -${AUTOCONF} -for sub in libltdl demo depdemo mdemo cdemo tagdemo pdemo; do +for sub in . libltdl cdemo demo depdemo mdemo pdemo tagdemo; do + case $sub in + .) + top_srcdir=. + acfiles="$top_srcdir/libtool.m4" + AUTOMAKE_FLAGS="--gnu --add-missing --copy" + ;; + libltdl) + top_srcdir=.. + acfiles="$top_srcdir/libtool.m4 $top_srcdir/ltdl.m4" + AUTOMAKE_FLAGS="--gnits --add-missing" + ;; + *) + top_srcdir=.. + acfiles="$top_srcdir/libtool.m4" + AUTOMAKE_FLAGS="--gnits --add-missing" + ;; + esac + cd $sub - rm -f acinclude.m4 - cat ../libtool.m4 > acinclude.m4 - test "$sub" = libltdl && cat ../ltdl.m4 >> acinclude.m4 - aclocal - test "$sub" = libltdl && ${AUTOHEADER} - ${AUTOMAKE} --gnits --add-missing - ${AUTOCONF} - cd .. + rm -f acinclude.m4 aclocal.m4 Makefile configure + for file in $acfiles; do + cat $file >> ./acinclude.m4 + done + + $ACLOCAL + test $sub = libltdl && $AUTOHEADER + eval $AUTOMAKE $AUTOMAKE_FLAGS + $AUTOCONF + cd $top_srcdir done -rm -f ltconfig ltmain.sh libtoolize +rm -f ltmain.sh libtoolize exit 0 diff --git a/cdemo/configure.ac b/cdemo/configure.ac new file mode 100644 index 000000000..0340ed981 --- /dev/null +++ b/cdemo/configure.ac @@ -0,0 +1,65 @@ +## Process this file with autoconf to create configure. -*- autoconf -*- +# Copyright 2001 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA + +AC_PREREQ(2.50) + + +## ------------------------ ## +## Autoconf initialisation. ## +## ------------------------ ## +AC_INIT([cdemo], [0.1], [bug-libtool@gnu.org]) +AC_CONFIG_SRCDIR([main.c]) + + +## ------------------------ ## +## Automake Initialisation. ## +## ------------------------ ## +AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION) + + +## ------------------ ## +## C compiler checks. ## +## ------------------ ## +AC_PROG_CC + + +## ----------------------- ## +## Libtool initialisation. ## +## ----------------------- ## +AM_PROG_LIBTOOL +AC_SUBST([LIBTOOL_DEPS]) + + +## ---------------------------- ## +## C headers required by cdemo. ## +## ---------------------------- ## +AC_CHECK_HEADERS([math.h]) + + +## ---------------------------- ## +## Libraries required by cdemo. ## +## ---------------------------- ## +AC_CHECK_LIBM +AC_SUBST([LIBM]) + + +## -------- ## +## Outputs. ## +## -------- ## +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/cdemo/configure.in b/cdemo/configure.in deleted file mode 100644 index cc1fed444..000000000 --- a/cdemo/configure.in +++ /dev/null @@ -1,17 +0,0 @@ -dnl Process this file with autoconf to create configure. - -AC_INIT(main.c) -AM_INIT_AUTOMAKE(cdemo,0.1) - -AC_PROG_CC -AC_EXEEXT -AM_PROG_LIBTOOL -AC_SUBST(LIBTOOL_DEPS) - -AC_CHECK_HEADERS(math.h) - -AC_CHECK_LIBM -AC_SUBST(LIBM) - -dnl Output the makefile -AC_OUTPUT(Makefile) diff --git a/commit b/commit index 591aa1039..e52b40a9f 100755 --- a/commit +++ b/commit @@ -8,7 +8,7 @@ # modified as defined in the GNU General Public License. A copy of # its license can be downloaded from http://www.gnu.org/copyleft/gpl.html -# Originally by Gary V. Vaughan +# Originally by Gary V. Vaughan # Heavily modified by Alexandre Oliva # This scripts eases checking in changes to CVS-maintained projects diff --git a/config.guess b/config.guess index 378eab84b..1c1090c72 100755 --- a/config.guess +++ b/config.guess @@ -1,9 +1,9 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. -timestamp='2001-03-30' +timestamp='2002-01-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -24,8 +24,9 @@ timestamp='2001-03-30' # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. -# Written by Per Bothner . -# Please send patches to . +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and @@ -52,7 +53,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -95,25 +96,25 @@ trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int dummy(){}" > $dummy.c +set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int dummy(){}" > $dummy.c ; for c in cc gcc c89 ; do - ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 + ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; if test $? = 0 ; then - CC_FOR_BUILD="$c"; break - fi - done - rm -f $dummy.c $dummy.o $dummy.rel + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $dummy.c $dummy.o $dummy.rel ; if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found + CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac +esac' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 8/24/94.) +# (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi @@ -127,29 +128,29 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) - # Netbsd (nbsd) targets should (where applicable) match one or + # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. - # Determine the machine/vendor (is the vendor relevant). - case "${UNAME_MACHINE}" in - amiga) machine=m68k-unknown ;; - arm32) machine=arm-unknown ;; - atari*) machine=m68k-atari ;; - sun3*) machine=m68k-sun ;; - mac68k) machine=m68k-apple ;; - macppc) machine=powerpc-apple ;; - hp3[0-9][05]) machine=m68k-hp ;; - ibmrt|romp-ibm) machine=romp-ibm ;; - *) machine=${UNAME_MACHINE}-unknown ;; + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + UNAME_MACHINE_ARCH=`(uname -p) 2>/dev/null` || \ + UNAME_MACHINE_ARCH=unknown + case "${UNAME_MACHINE_ARCH}" in + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. - case "${UNAME_MACHINE}" in - i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then @@ -171,6 +172,45 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` @@ -204,6 +244,7 @@ main: jsr \$26,exit .end main EOF + eval $set_cc_for_build $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then case `./$dummy` in @@ -225,6 +266,9 @@ EOF 2-307) UNAME_MACHINE="alphaev67" ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; esac fi rm -f $dummy.s $dummy @@ -242,29 +286,11 @@ EOF Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; - arc64:OpenBSD:*:*) - echo mips64el-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hkmips:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -328,9 +354,6 @@ EOF aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; - atari*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -357,18 +380,6 @@ EOF *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; - sun3*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; @@ -385,6 +396,7 @@ EOF echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ @@ -412,6 +424,9 @@ EOF rm -f $dummy.c $dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; @@ -459,7 +474,7 @@ EOF ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i?86:AIX:*:*) + i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) @@ -472,6 +487,7 @@ EOF exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include @@ -533,10 +549,8 @@ EOF 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) - case "${HPUX_REV}" in - 11.[0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 @@ -545,12 +559,13 @@ EOF case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac - fi ;; - esac - if [ "${HP_ARCH}" = "" ]; then - sed 's/^ //' << EOF >$dummy.c + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include @@ -583,10 +598,10 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` - if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi - rm -f $dummy.c $dummy - fi ;; + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy + fi ;; esac echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; @@ -595,6 +610,7 @@ EOF echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) + eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int @@ -630,7 +646,7 @@ EOF 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; - *9??*:MPE/iX:*:*) + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) @@ -639,7 +655,7 @@ EOF hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; - i?86:OSF1:*:*) + i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else @@ -649,9 +665,6 @@ EOF parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; - hppa*:OpenBSD:*:*) - echo hppa-unknown-openbsd - exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; @@ -674,12 +687,13 @@ EOF echo xmp-cray-unicos exit 0 ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' @@ -702,10 +716,7 @@ EOF FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) @@ -717,9 +728,6 @@ EOF *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; @@ -729,6 +737,9 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; + x86:Interix*:3*) + echo i386-pc-interix3 + exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we @@ -760,97 +771,43 @@ EOF echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) - cat >$dummy.c < /* for printf() prototype */ -int main (int argc, char *argv[]) { -#else -int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __MIPSEB__ - printf ("%s-unknown-linux-gnu\n", argv[1]); -#endif -#ifdef __MIPSEL__ - printf ("%sel-unknown-linux-gnu\n", argv[1]); -#endif - return 0; -} + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + rm -f $dummy.c + test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 ;; ppc:Linux:*:*) - # Determine Lib Version - cat >$dummy.c < -#if defined(__GLIBC__) -extern char __libc_version[]; -extern char __libc_release[]; -#endif -main(argc, argv) - int argc; - char *argv[]; -{ -#if defined(__GLIBC__) - printf("%s %s\n", __libc_version, __libc_release); -#else - printf("unknown\n"); -#endif - return 0; -} -EOF - LIBC="" - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null - if test "$?" = 0 ; then - ./$dummy | grep 1\.99 > /dev/null - if test "$?" = 0 ; then LIBC="libc1" ; fi - fi - rm -f $dummy.c $dummy - echo powerpc-unknown-linux-gnu${LIBC} + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) - cat <$dummy.s - .data - \$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - .text - .globl main - .align 4 - .ent main - main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - LIBC="" - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - case `./$dummy` in - 0-0) UNAME_MACHINE="alpha" ;; - 1-0) UNAME_MACHINE="alphaev5" ;; - 1-1) UNAME_MACHINE="alphaev56" ;; - 1-101) UNAME_MACHINE="alphapca56" ;; - 2-303) UNAME_MACHINE="alphaev6" ;; - 2-307) UNAME_MACHINE="alphaev67" ;; - esac - objdump --private-headers $dummy | \ - grep ld.so.1 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.s $dummy + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) @@ -876,78 +833,62 @@ EOF x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; - i?86:Linux:*:*) + i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. - ld_supported_emulations=`cd /; ld --help 2>&1 \ - | sed -ne '/supported emulations:/!d + ld_supported_targets=`cd /; ld --help 2>&1 \ + | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g - s/.*supported emulations: *// + s/.*supported targets: *// s/ .*// p'` - case "$ld_supported_emulations" in - i?86linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 - ;; - elf_i?86) + case "$ld_supported_targets" in + elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; - i?86coff) + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 - ;; - esac - # Either a pre-BFD a.out linker (linux-gnuoldld) - # or one that does not give us useful --help. - # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. - # If ld does not provide *any* "supported emulations:" - # that means it is gnuoldld. - test -z "$ld_supported_emulations" && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 - case "${UNAME_MACHINE}" in - i?86) - VENDOR=pc; - ;; - *) - VENDOR=unknown; - ;; + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; esac # Determine whether the default compiler is a.out or elf - cat >$dummy.c < -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __ELF__ -# ifdef __GLIBC__ -# if __GLIBC__ >= 2 - printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -#else - printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); -#endif - return 0; -} + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + LIBC=gnuaout + #endif EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; -# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions -# are messed up and put the nodename in both sysname and nodename. - i?86:DYNIX/ptx:4*:*) + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; - i?86:UNIX_SV:4.2MP:2.*) + i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, @@ -955,7 +896,7 @@ EOF # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; - i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} @@ -963,16 +904,15 @@ EOF echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; - i?86:*:5:7*) - # Fixed at (any) Pentium or better - UNAME_MACHINE=i586 - if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then - echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} - fi + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; - i?86:*:3.2:*) + i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) @@ -1077,6 +1017,10 @@ EOF # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; @@ -1123,7 +1067,7 @@ EOF *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; - NSR-[KW]:NONSTOP_KERNEL:*:*) + NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) @@ -1146,7 +1090,7 @@ EOF fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; - i?86:OS/2:*:*) + i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx @@ -1169,11 +1113,18 @@ EOF *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 +eval $set_cc_for_build cat >$dummy.c < diff --git a/config.sub b/config.sub index 4ac0c8b0c..16573348b 100755 --- a/config.sub +++ b/config.sub @@ -1,9 +1,9 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. -timestamp='2001-03-30' +timestamp='2002-01-02' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -29,7 +29,8 @@ timestamp='2001-03-30' # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. -# Please send patches to . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -117,7 +118,7 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | storm-chaos* | os2-emx*) + nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -157,6 +158,14 @@ case $os in os=-vxworks basic_machine=$1 ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; -hiux*) os=-hiuxwe2 ;; @@ -215,25 +224,36 @@ esac case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. - tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \ - | arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \ - | pyramid | mn10200 | mn10300 | tron | a29k \ - | 580 | i960 | h8300 \ - | x86 | ppcbe | mipsbe | mipsle | shbe | shle \ - | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ - | hppa64 \ - | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ - | alphaev6[78] \ - | we32k | ns16k | clipper | i370 | sh | sh[34] \ - | powerpc | powerpcle \ - | 1750a | dsp16xx | pdp10 | pdp11 \ - | mips16 | mips64 | mipsel | mips64el \ - | mips64orion | mips64orionel | mipstx39 | mipstx39el \ - | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ - | mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \ - | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ - | thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \ - | pj | pjl | h8500) + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dsp16xx \ + | fr30 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el | mips64vr4300 \ + | mips64vr4300el | mips64vr5000 | mips64vr5000el \ + | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ + | mipsisa32 \ + | mn10200 | mn10300 \ + | ns16k | ns32k \ + | openrisc \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[34] | sh[34]eb | shbe | shle \ + | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) @@ -241,13 +261,13 @@ case $basic_machine in basic_machine=$basic_machine-unknown os=-none ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | w65) + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. - i[234567]86 | x86_64) + i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. @@ -256,30 +276,45 @@ case $basic_machine in exit 1 ;; # Recognize the basic CPU types with company name. - # FIXME: clean up the formatting here. - vax-* | tahoe-* | i[234567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ - | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \ - | arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \ - | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ - | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ - | xmp-* | ymp-* \ - | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \ - | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \ - | hppa2.0n-* | hppa64-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \ - | alphaev6[78]-* \ - | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ - | clipper-* | orion-* \ - | sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ - | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ - | mips64el-* | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ - | mipstx39-* | mipstx39el-* | mcore-* \ - | f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \ - | [cjt]90-* \ - | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ - | thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \ - | bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*) + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c54x-* \ + | clipper-* | cray2-* | cydra-* \ + | d10v-* | d30v-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | m32r-* \ + | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ + | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ + | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* \ + | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | ymp-* \ + | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. @@ -386,6 +421,14 @@ case $basic_machine in decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola @@ -506,19 +549,19 @@ case $basic_machine in basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? - i[34567]86v32) + i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; - i[34567]86v4*) + i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; - i[34567]86v) + i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; - i[34567]86sol2) + i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; @@ -588,6 +631,10 @@ case $basic_machine in basic_machine=m68k-rom68k os=-coff ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; msdos) basic_machine=i386-pc os=-msdos @@ -692,7 +739,7 @@ case $basic_machine in pc532 | pc532-*) basic_machine=ns32k-pc532 ;; - pentium | p5 | k5 | k6 | nexgen) + pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon) @@ -701,7 +748,7 @@ case $basic_machine in pentiumii | pentium2) basic_machine=i686-pc ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-*) + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) @@ -725,6 +772,16 @@ case $basic_machine in ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; ps2) basic_machine=i386-ibm ;; @@ -742,6 +799,12 @@ case $basic_machine in rtpc | rtpc-*) basic_machine=romp-ibm ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; sa29200) basic_machine=a29k-amd os=-udi @@ -753,7 +816,7 @@ case $basic_machine in basic_machine=sh-hitachi os=-hms ;; - sparclite-wrs) + sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; @@ -833,6 +896,10 @@ case $basic_machine in tx39el) basic_machine=mipstx39el-unknown ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; tower | tower-32) basic_machine=m68k-ncr ;; @@ -879,6 +946,10 @@ case $basic_machine in basic_machine=hppa1.1-winbond os=-proelf ;; + windows32) + basic_machine=i386-pc + os=-windows32-msvcrt + ;; xmp) basic_machine=xmp-cray os=-unicos @@ -932,10 +1003,10 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh3 | sh4) + sh3 | sh4 | sh3eb | sh4eb) basic_machine=sh-unknown ;; - sparc | sparcv9) + sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) @@ -1016,16 +1087,18 @@ case $os in | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*) + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* | -morphos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in - x86-* | i[34567]86-*) + x86-* | i*86-*) ;; *) os=-nto$os @@ -1072,6 +1145,9 @@ case $os in -acis*) os=-aos ;; + -atheos*) + os=-atheos + ;; -386bsd) os=-bsd ;; @@ -1152,6 +1228,7 @@ case $basic_machine in arm*-semi) os=-aout ;; + # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; @@ -1344,6 +1421,9 @@ case $basic_machine in -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; + -vos*) + vendor=stratus + ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; diff --git a/configure.ac b/configure.ac new file mode 100644 index 000000000..0292f5e7e --- /dev/null +++ b/configure.ac @@ -0,0 +1,130 @@ +## Process this file with autoconf to create configure. -*- autoconf -*- +# Copyright 2001 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA + + +## FIXME: Is this really new enough? ## +AC_PREREQ(2.50) + + + +## ------------------------ ## +## Autoconf initialisation. ## +## ------------------------ ## +AC_INIT([libtool], [1.4e], [bug-libtool@gnu.org]) +AC_CONFIG_SRCDIR([ltmain.in]) + + + +## ---------------------------------------- ## +## Display a configure time version banner. ## +## ---------------------------------------- ## + +# This is a sanity check so we can see which version is used in bug reports. +# It is assumed that we only want to see the date extension for cvs libtool +# versions (i.e. "odd" letters) and not actual alpha releases. +TIMESTAMP= +case AC_PACKAGE_VERSION in + [*[acegikmoqsuwy])] + TIMESTAMP=`${CONFIG_SHELL} ${srcdir}/mkstamp < ${srcdir}/ChangeLog` + AS_BOX([Configuring AC_PACKAGE_TARNAME AC_PACKAGE_VERSION$TIMESTAMP]) + echo + ;; +esac +AC_SUBST([TIMESTAMP]) + + + +## ------------------------ ## +## Automake Initialisation. ## +## ------------------------ ## +AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION) + + + +## ------------------------------- ## +## Libtool specific configuration. ## +## ------------------------------- ## +pkgdatadir='${datadir}'"/${PACKAGE}" +AC_SUBST([pkgdatadir]) # automake does not need this, but libtoolize does + +aclocaldir='${datadir}/aclocal' +AC_SUBST([aclocaldir]) + +AC_ARG_ENABLE(ltdl-install, + [AC_HELP_STRING([--disable-ltdl-install], [do not install libltdl])]) +if test x"${enable_ltdl_install+set}" != xset; then + enable_ltdl_install=yes + ac_configure_args="$ac_configure_args --enable-ltdl-install" +fi +AC_CONFIG_SUBDIRS([libltdl]) + +# all subdirectories that are configured on demand, but that must be +# included in the distribution +CONF_SUBDIRS="cdemo pdemo demo depdemo mdemo tagdemo" +AC_SUBST([CONF_SUBDIRS]) + +ACINCLUDE_M4_LIST="${srcdir}/acinclude.m4" +DIST_MAKEFILE_LIST= +for dir in $CONF_SUBDIRS; do + ACINCLUDE_M4_LIST="$ACINCLUDE_M4_LIST ${srcdir}/$dir/acinclude.m4" + DIST_MAKEFILE_LIST="$DIST_MAKEFILE_LIST$dir/Makefile " +done +AC_SUBST([ACINCLUDE_M4_LIST]) +AC_SUBST([DIST_MAKEFILE_LIST]) + + + +## ---------------- ## +## compiler checks. ## +## ---------------- ## + +# Use the specified CC and LD +AC_PROG_CC +AM_PROG_LD +AC_SUBST(LD) +AM_PROG_NM +AC_SUBST(NM) +AC_PROG_LN_S + +pushdef([AC_MSG_ERROR], [CXX=no]) +AC_PROG_CXX +popdef([AC_MSG_ERROR]) +AM_CONDITIONAL(HAVE_CXX, [test "x$CXX" != xno]) + +LT_AC_PROG_GCJ +AM_CONDITIONAL(HAVE_GCJ, [test "x$GCJ" != xno]) + +LT_AC_PROG_RC +AM_CONDITIONAL(HAVE_RC, [test "x$RC" != xno]) + + + +## ----------------------- ## +## Libtool initialisation. ## +## ----------------------- ## +AC_LIBTOOL_DLOPEN +AC_LIBTOOL_WIN32_DLL +AC_PROG_LIBTOOL + + + +## -------- ## +## Outputs. ## +## -------- ## +AC_CONFIG_FILES([Makefile doc/Makefile tests/Makefile]) +AC_OUTPUT diff --git a/demo/Makefile.am b/demo/Makefile.am index 81c7a845c..9c58735d4 100644 --- a/demo/Makefile.am +++ b/demo/Makefile.am @@ -40,7 +40,7 @@ else bin_SCRIPTS = helldl # create a script that says that -dlopen is not supported -helldl: +helldl helldl$(EXEEXT): rm -f $@ echo '#! /bin/sh' > $@ echo '-dlopen is unsupported' >> $@ diff --git a/demo/configure.ac b/demo/configure.ac new file mode 100644 index 000000000..d420d409c --- /dev/null +++ b/demo/configure.ac @@ -0,0 +1,77 @@ +## Process this file with autoconf to create configure. -*- autoconf -*- +# Copyright 2001 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA + +AC_PREREQ(2.50) + + +## ------------------------ ## +## Autoconf initialisation. ## +## ------------------------ ## +AC_INIT([demo], [1.0], [bug-libtool@gnu.org]) +AC_CONFIG_SRCDIR([hello.c]) + + +## ------------------------ ## +## Automake Initialisation. ## +## ------------------------ ## +AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION) + + +## ---------------- ## +## compiler checks. ## +## ---------------- ## +AC_PROG_CC +AC_C_CONST + + +## ----------------------- ## +## Libtool initialisation. ## +## ----------------------- ## +AC_LIBTOOL_DLOPEN +AM_PROG_LIBTOOL +AC_SUBST([LIBTOOL_DEPS]) + +if ./libtool --features | grep '^enable static libraries$' > /dev/null 2>&1; then + STATIC=-static +else + STATIC= +fi +AC_SUBST([STATIC]) + +AM_CONDITIONAL([BINARY_HELLDL], + [grep '^global_symbol_pipe=..*$' ./libtool >/dev/null]) + + +## ---------------------------- ## +## C headers required by cdemo. ## +## ---------------------------- ## +AC_CHECK_HEADERS([string.h math.h]) + + +## --------------------------- ## +## Libraries required by demo. ## +## --------------------------- ## +AC_CHECK_LIBM +AC_SUBST([LIBM]) + + +## -------- ## +## Outputs. ## +## -------- ## +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/demo/configure.in b/demo/configure.in deleted file mode 100644 index 4257eca1b..000000000 --- a/demo/configure.in +++ /dev/null @@ -1,29 +0,0 @@ -dnl Process this file with autoconf to create configure. - -AC_INIT(hello.c) -AM_INIT_AUTOMAKE(hell,1.0) - -AC_PROG_CC -AC_C_CONST -AC_EXEEXT -AC_LIBTOOL_DLOPEN -AM_PROG_LIBTOOL -AC_SUBST(LIBTOOL_DEPS) - -if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then - STATIC=-static -else - STATIC= -fi -AC_SUBST(STATIC) - -AM_CONDITIONAL(BINARY_HELLDL, [dnl -grep '^global_symbol_pipe=..*$' ./libtool >/dev/null]) - -AC_CHECK_HEADERS(string.h math.h) - -AC_CHECK_LIBM -AC_SUBST(LIBM) - -dnl Output the makefile -AC_OUTPUT(Makefile) diff --git a/depdemo/configure.ac b/depdemo/configure.ac new file mode 100644 index 000000000..f49c31355 --- /dev/null +++ b/depdemo/configure.ac @@ -0,0 +1,76 @@ +## Process this file with autoconf to create configure. -*- autoconf -*- +# Copyright 2001 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA + +AC_PREREQ(2.50) + + +## ------------------------ ## +## Autoconf initialisation. ## +## ------------------------ ## +AC_INIT([depdemo], [0.1], [bug-libtool@gnu.org]) +AC_CONFIG_SRCDIR([main.c]) + + +## ------------------------------- ## +## depdemo specific configuration. ## +## ------------------------------- ## +if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then + STATIC=-static +else + STATIC= +fi +AC_SUBST([STATIC]) + + +## ------------------------ ## +## Automake Initialisation. ## +## ------------------------ ## +AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION) + + +## ---------------- ## +## compiler checks. ## +## ---------------- ## +AC_PROG_CC + + +## ----------------------- ## +## Libtool initialisation. ## +## ----------------------- ## +AM_PROG_LIBTOOL +AC_SUBST([LIBTOOL_DEPS]) + + +## ---------------------------- ## +## C headers required by cdemo. ## +## ---------------------------- ## +AC_CHECK_HEADERS([math.h]) + + +## ---------------------------- ## +## Libraries required by cdemo. ## +## ---------------------------- ## +AC_CHECK_LIBM +AC_SUBST([LIBM]) + + +## -------- ## +## Outputs. ## +## -------- ## +AC_CONFIG_FILES([Makefile l1/Makefile l2/Makefile l3/Makefile l4/Makefile]) +AC_OUTPUT diff --git a/depdemo/configure.in b/depdemo/configure.in deleted file mode 100644 index 157b5127d..000000000 --- a/depdemo/configure.in +++ /dev/null @@ -1,30 +0,0 @@ -dnl Process this file with autoconf to create configure. - -AC_INIT(main.c) -AM_INIT_AUTOMAKE(depdemo,0.1) - -AC_PROG_CC -AC_EXEEXT -AM_PROG_LIBTOOL -AC_SUBST(LIBTOOL_DEPS) - -if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then - STATIC=-static -else - STATIC= -fi -AC_SUBST(STATIC) - -AC_CHECK_HEADERS(math.h) - -AC_CHECK_LIBM -AC_SUBST(LIBM) - -dnl Output the makefile -AC_OUTPUT( -Makefile -l1/Makefile -l2/Makefile -l3/Makefile -l4/Makefile -) diff --git a/doc/PLATFORMS b/doc/PLATFORMS index 35be8bdfe..9f3a12e9c 100644 --- a/doc/PLATFORMS +++ b/doc/PLATFORMS @@ -2,9 +2,9 @@ canonical host name compiler libtool results (tools versions) release ------------------------------------------------------- -alpha-dec-osf4.0* gcc 1.3b ok - (egcs-1.1.2) -alpha-dec-osf4.0* cc 1.3b ok +alpha-dec-osf5.1 cc 1.3e ok (1.910) +alpha-dec-osf4.0f gcc 1.3e ok (1.910) +alpha-dec-osf4.0f cc 1.3e ok (1.910) alpha-dec-osf3.2 gcc 0.8 ok alpha-dec-osf3.2 cc 0.8 ok alpha-dec-osf2.1 gcc 1.2f NS @@ -13,7 +13,7 @@ alpha*-unknown-linux-gnu gcc 1.3b ok hppa2.0w-hp-hpux11.00 cc 1.2f ok hppa2.0-hp-hpux10.20 cc 1.3.2 ok hppa1.1-hp-hpux10.20 gcc 1.2f ok -hppa1.1-hp-hpux10.20 cc 1.2f ok +hppa1.1-hp-hpux10.20 cc 1.3c ok (1.821) hppa1.1-hp-hpux10.10 gcc 1.2f ok hppa1.1-hp-hpux10.10 cc 1.2f ok hppa1.1-hp-hpux9.07 gcc 1.2f ok @@ -32,6 +32,7 @@ i*86-*-bsdi2.1 gcc 1.2e NS i*86-pc-cygwin gcc 1.3b NS (egcs-1.1 stock b20.1 compiler) i*86-*-dguxR4.20MU01 gcc 1.2 ok +i*86-*-freebsd4.3 gcc 1.3e ok (1.912) i*86-*-freebsdelf4.0 gcc 1.3c ok (egcs-1.1.2) i*86-*-freebsdelf3.2 gcc 1.3c ok @@ -45,17 +46,21 @@ i*86-*-freebsd2.2.8 gcc 1.3c ok i*86-*-freebsd2.2.6 gcc 1.3b ok (egcs-1.1 & gcc-2.7.2.1, native ld) i*86-*-freebsd2.1.5 gcc 0.5 ok -i*86-*-gnu gcc 1.3c ok (1.602) +i*86-*-netbsd1.5 gcc 1.3e ok (1.901) + (egcs-1.1.2) i*86-*-netbsd1.4 gcc 1.3c ok (egcs-1.1.1) +i*86-*-netbsd1.4.3A gcc 1.3e ok (1.901) i*86-*-netbsd1.3.3 gcc 1.3c ok (gcc-2.7.2.2+myc2) i*86-*-netbsd1.3.2 gcc 1.2e ok i*86-*-netbsd1.3I gcc 1.2e ok (egcs 1.1?) i*86-*-netbsd1.2 gcc 0.9g ok -i*86-*-linux-gnu gcc 1.3b ok - (egcs-1.1.2, GNU ld 2.9.1.0.23) +i*86-*-linux-gnu gcc 1.3e ok (1.901) + (Red Hat 7.0, gcc "2.96") +i*86-*-linux-gnu gcc 1.3e ok (1.911) + (SuSE 7.0, gcc 2.95.2) i*86-*-linux-gnulibc1 gcc 1.2f ok i*86-*-openbsd2.5 gcc 1.3c ok (gcc-2.8.1) @@ -73,6 +78,8 @@ i*86-pc-sco3.2v5.0.5 gcc 1.3c ok (gcc 95q4c) i*86-pc-sco3.2v5.0.5 gcc 1.3c ok (egcs-1.1.2) +i*86-sco-sysv5uw7.1.1 gcc 1.3e ok (1.901) + (gcc-2.95.2, SCO linker) i*86-UnixWare7.1.0-sysv5 cc 1.3c ok i*86-UnixWare7.1.0-sysv5 gcc 1.3c ok (egcs-1.1.1) @@ -100,6 +107,10 @@ mips-sgi-irix5.2 gcc 1.3b ok (egcs-1.1.2, native ld) mips-sgi-irix5.2 cc 1.3b ok (cc 3.18) +mips-sni-sysv4 cc 1.3.5 ok + (Siemens C-compiler) +mips-sni-sysv4 gcc 1.3.5 ok + (gcc-2.7.2.3, GNU assembler 2.8.1, native ld) mipsel-unknown-openbsd2.1 gcc 1.0 ok powerpc-ibm-aix4.3.1.0 gcc 1.2f ok (egcs-1.1.1) @@ -117,11 +128,13 @@ rs6000-ibm-aix4.1.4.0 gcc 1.2f ok (gcc-2.7.2) rs6000-ibm-aix3.2.5 gcc 1.0i ok rs6000-ibm-aix3.2.5 xlc 1.0i ok -sparc-sun-solaris2.7 gcc 1.3b ok - (egcs-1.1.2, GNU ld 2.9.1 & native ld) -sparc-sun-solaris2.6 gcc 1.3.2 ok - (egcs-1.1.2, GNU ld 2.9.1 & native ld) -sparc-sun-solaris2.5.1 gcc 1.2f ok +sparc-sun-solaris2.8 gcc 1.3e ok (1.913) + (gcc-2.95.3 & native ld) +sparc-sun-solaris2.7 gcc 1.3e ok (1.913) + (gcc-2.95.3 & native ld) +sparc-sun-solaris2.6 gcc 1.3e ok (1.913) + (gcc-2.95.3 & native ld) +sparc-sun-solaris2.5.1 gcc 1.3e ok (1.911) sparc-sun-solaris2.5 gcc 1.3b ok (egcs-1.1.2, GNU ld 2.9.1 & native ld) sparc-sun-solaris2.5 cc 1.3b ok diff --git a/doc/libtool.texi b/doc/libtool.texi index fca68d49f..8f448e386 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -1,7 +1,4 @@ \input texinfo @c -*-texinfo-*- - -@c $Id$ - @c %**start of header @setfilename libtool.info @settitle Libtool @@ -139,9 +136,7 @@ Integrating libtool with your package Configuring libtool -* Invoking ltconfig:: @code{ltconfig} command line options. -* ltconfig example:: Manually configuring a @code{libtool}. -* AM_PROG_LIBTOOL:: Configuring @code{libtool} in @file{configure.in}. +* AC_PROG_LIBTOOL:: Configuring @code{libtool} in @file{configure.in}. Including libtool in your package @@ -1068,6 +1063,15 @@ be executed by libtool. Display basic configuration options. This provides a way for packages to determine whether shared or static libraries will be built. +@item --preserve-dup-deps +Do not remove duplicate dependencies in libraries. When building packages +with static libraries, the libraries may depend circularly on each other +(shared libs can too, but for those it doesn't matter), so there are +situations, where -la -lb -la is required, and the second -la may not be +stripped or the link will fail. In cases where these duplications are +required, this option will preserve them, only stripping the libraries +that libtool knows it can safely. + @item --finish Same as @samp{--mode=finish}. @@ -1076,16 +1080,6 @@ Display a help message and exit. If @samp{--mode=@var{mode}} is specified, then detailed help for @var{mode} is displayed. -@item --tag=@var{tag} -Select configuration tag @var{tag}. Additional configuration tags can -be created with @code{ltconfig --add-tag}. Multiple @samp{--tag} flags -can be specified. In general, one tag will completely replace the -configuration of the other, but the two pre-defined configuration tags, -@samp{disable-shared} and @samp{disable-static}, if used @emph{after} -any other, cause libtool not to create shared or static libraries, -respectively, regardless of the corresponding flags used for -@code{ltconfig}. - @item --mode=@var{mode} Use @var{mode} as the operation mode. By default, the operation mode is inferred from the @var{mode-args}. @@ -1239,17 +1233,6 @@ Same as @samp{-export-symbols}, except that only symbols matching the regular expression @var{regex} are exported. By default all symbols are exported. -@item -objectlist @var{input-file} -Tells libtool to read a text file to determine the object files -to be linked. The @var{input-file} is a text file containing a list -of libtool objects (@samp{.lo} files), one per line. This option is -used to build arbitrarily large libraries when the libtool command -becomes too large for the system to execute. Creating this file can -be automated with a command like the following: -@example -@kbd{find ./ -name \*.lo -print | sed 's/.\///g' > inputfile.txt} -@end example - @item -L@var{libdir} Search @var{libdir} for required libraries that have already been installed. @@ -1267,15 +1250,13 @@ In order to prevent name clashes, however, 'libname' and 'name' must not be used at the same time in your package. @item -no-fast-install -Disable fast-install mode for the executable @var{output-file} -(@pxref{Invoking ltconfig}). Useful if the program won't be necessarly -installed. +Disable fast-install mode for the executable @var{output-file}. Useful +if the program won't be necessarily installed. @item -no-install -Link an executable @var{output-file} (@pxref{Invoking ltconfig}) that -can't be installed and therefore doesn't need a wrapper script. -Useful if the program is only used in the build tree, e.g., -for testing or generating other files. +Link an executable @var{output-file} that can't be installed and +therefore doesn't need a wrapper script. Useful if the program is only +used in the build tree, e.g., for testing or generating other files. @item -no-undefined Declare that @var{output-file} does not depend on any other libraries. @@ -1555,254 +1536,31 @@ system features, then generates the @file{Makefiles} (and possibly a @file{config.h} header file), after which you can run @code{make} and build the package. -Libtool has its own equivalent to the @code{configure} script, -@code{ltconfig}. +Libtool adds its own tests to your @code{configure} script in order to +generate a libtool script for the installer's host machine. @menu -* Invoking ltconfig:: @code{ltconfig} command line options. -* ltconfig example:: Manually configuring a @code{libtool}. -* AM_PROG_LIBTOOL:: Configuring @code{libtool} in @file{configure.in}. +* AC_PROG_LIBTOOL:: Configuring @code{libtool} in @file{configure.in}. @end menu -@node Invoking ltconfig -@subsection Invoking @code{ltconfig} -@pindex ltconfig -@cindex ltconfig command options -@cindex options, ltconfig command -@cindex command options, ltconfig - -@code{ltconfig} runs a series of configuration tests, then creates a -system-specific @code{libtool} in the current directory. The -@code{ltconfig} program has the following synopsis: - -@example -ltconfig [@var{option}]@dots{} @var{ltmain} [@var{host}] -@end example - -@noindent -and accepts the following options: - -@table @samp -@item --build=@var{build} -Set the build system to be different to the host system. This creates a -libtool which prefers build tools which are prefixed by the host alias over -the standard tools. For example, specifying @code{--build=i486-pc-linux-gnu} -on a host described by i486-pc-cygwin would create a libtool which used -@code{i486-pc-cygwin-ranlib} in preference to @code{ranlib} if present. This -is useful for cross build environments. - -@item --debug -Dump a trace of shell script execution to standard output. This -produces a lot of output, so you may wish to pipe it to @code{less} (or -@code{more}) or redirect to a file. - -@item --disable-shared -Create a @code{libtool} that only builds static libraries. - -@item --disable-static -Create a @code{libtool} that builds only shared libraries if they are -available. If only static libraries can be built, then this flag has -no effect. - -@item --disable-fast-install -On platforms in which installable executables, that are created by -default, are not suitable for execution in the build directory, create a -@code{libtool} that links executables that search for uninstalled -libraries by default, and relinks them at install time. It is ignored -on platforms in which a single executable is enough. - -@item --enable-dlopen -Test whether some dlopening mechanism is supported. If this flag is not -given, or no working dlopening mechanism is found, create a -@code{libtool} that performs dlpreopening of all dlopened modules. - -@item --help -Display a help message and exit. - -@item --no-verify -Do not use @code{config.sub} to verify that @var{host} is a valid -canonical host system name. - -@item --output=@var{file} -@item -o @var{file} -Instead of creating a libtool script called @code{libtool}, create one -called @var{file}. This can be useful if you want to create libtool -scripts for cross-compilers, or you want to have more than one libtool -in the same directory. - -@item --quiet -@itemx --silent -Do not print informational messages when running configuration tests. - -@item --srcdir=@var{dir} -Look for @code{config.guess} and @code{config.sub} in @var{dir}. - -@item --version -Print @code{ltconfig} version information and exit. - -@item --add-tag=@var{tag} -Instead of overwriting @code{libtool}, append a new configuration -section to it, with the given @var{tag}. - -@item --with-gcc -Assume that the GNU C compiler will be used when invoking the created -@code{libtool} to compile and link object files. - -@item --with-gnu-ld -Assume that the C compiler uses the GNU linker. - -@item --disable-lock -Create a @code{libtool} that does not perform locking to ensure proper -parallel compilation if the C compiler does not support @samp{-c} and -@samp{-o} together. - -@item --cache-file=@var{file} -Use this @var{file} as a cache for results of a few tests. This is -usually @file{config.cache} used by @code{configure}. By default, no -cache file is used. -@end table - -@var{ltmain} is the @code{ltmain.sh} shell script fragment that provides -the basic libtool functionality (@pxref{Distributing}). - -@var{host} is the canonical host system name, which by default is -guessed by running @code{config.guess}. - -@code{ltconfig} also recognizes the following environment variables: - -@defvar CC -The compiler that will be used by the generated @code{libtool}. If -this is not set, @code{ltconfig} will look for @code{gcc} or @code{cc}. -@end defvar - -@defvar LTCC -A C compiler, in case @var{CC} is not one. If this is not set, -@code{ltconfig} will use @var{CC} or extract @var{LTCC} from an existing -@code{libtool}, if running in @samp{--add-tag} mode. -@end defvar - -@defvar CFLAGS -Compiler flags used to generate standard object files. If this is not -set, @code{ltconfig} will not use any such flags. It affects only the -way @code{ltconfig} runs tests, not the produced @code{libtool}. -@end defvar - -@defvar CPPFLAGS -C preprocessor flags. If this is not set, @code{ltconfig} will not use -any such flags. It affects only the way @code{ltconfig} runs tests, not -the produced @code{libtool}. -@end defvar - -@defvar LD -The system linker to use (if the generated @code{libtool} requires one). -If this is not set, @code{ltconfig} will try to find out what is the -linker used by @var{CC}. -@end defvar - -@defvar LDFLAGS -The flags to be used by @code{ltconfig} when it links a program. If -this is not set, @code{ltconfig} will not use any such flags. It -affects only the way @code{ltconfig} runs tests, not the produced -@code{libtool}. -@end defvar - -@defvar LIBS -The libraries to be used by @code{ltconfig} when it links a program. If -this is not set, @code{ltconfig} will not use any such flags. It -affects only the way @code{ltconfig} runs tests, not the produced -@code{libtool}. -@end defvar - -@defvar NM -Program to use rather than checking for @code{nm}. -@end defvar - -@defvar RANLIB -Program to use rather than checking for @code{ranlib}. -@end defvar - -@defvar LN_S -A command that creates a link of a program, a soft-link if possible, a -hard-link otherwise. -@end defvar - -@defvar DLLTOOL -Program to use rather than checking for @code{dlltool}. Only meaningful -for Cygwin/MS-Windows. -@end defvar - -@defvar OBJDUMP -Program to use rather than checking for @code{objdump}. Only meaningful -for Cygwin/MS-Windows. -@end defvar - -@defvar AS -Program to use rather than checking for @code{as}. Only meaningful for -Cygwin/MS-Windows. -@end defvar - -@node ltconfig example -@subsection Using @code{ltconfig} - -Here is a simple example of using @code{ltconfig} to configure libtool -on a NetBSD/i386 1.2 system: - -@example -burger$ @kbd{./ltconfig ltmain.sh} -checking host system type... i386-unknown-netbsd1.2 -checking for ranlib... ranlib -checking for gcc... gcc -checking whether we are using GNU C... yes -checking for gcc option to produce PIC... -fPIC -DPIC -checking for gcc option to statically link programs... -static -checking if ld is GNU ld... no -checking if ld supports shared libraries... yes -checking dynamic linker characteristics... netbsd1.2 ld.so -checking if libtool supports shared libraries... yes -checking whether to build shared libraries... yes -creating libtool -burger$ -@end example - -This example shows how to configure @code{libtool} for cross-compiling -to a i486 GNU/Hurd 0.1 system (assuming compiler tools reside in -@file{/local/i486-gnu/bin}): - -@example -burger$ export PATH=/local/i486-gnu/bin:$PATH -burger$ ./ltconfig ltmain.sh i486-gnu0.1 -checking host system type... i486-unknown-gnu0.1 -checking for ranlib... ranlib -checking for gcc... gcc -checking whether we are using GNU C... yes -checking for gcc option to produce PIC... -fPIC -DPIC -checking for gcc option to statically link programs... -static -checking if ld is GNU ld... yes -checking if GNU ld supports shared libraries... yes -checking dynamic linker characteristics... gnu0.1 ld.so -checking if libtool supports shared libraries... yes -checking whether to build shared libraries... yes -creating libtool -burger$ -@end example - -@node AM_PROG_LIBTOOL -@subsection The @code{AM_PROG_LIBTOOL} macro +@node AC_PROG_LIBTOOL +@subsection The @code{AC_PROG_LIBTOOL} macro If you are using GNU Autoconf (or Automake), you should add a call to -@code{AM_PROG_LIBTOOL} to your @file{configure.in} file. This macro -offers seamless integration between the @code{configure} script and -@code{ltconfig}: +@code{AC_PROG_LIBTOOL} to your @file{configure.in} file. This macro +adds many new tests to the @code{configure} script so that the generated +libtool script will understand the characteristics of the host: -@defmac AM_PROG_LIBTOOL +@defmac AC_PROG_LIBTOOL +@defmacx AM_PROG_LIBTOOL Add support for the @samp{--enable-shared} and @samp{--disable-shared} -@code{configure} flags. Invoke @code{ltconfig} with the correct -arguments to configure the package (@pxref{Invoking -ltconfig}).@footnote{@code{AM_PROG_LIBTOOL} requires that you define the -@file{Makefile} variable @code{top_builddir} in your @file{Makefile.in}. -Automake does this automatically, but Autoconf users should set it to -the relative path to the top of your build directory (@file{../..}, for -example).} +@code{configure} flags.@footnote{@code{AC_PROG_LIBTOOL} requires that +you define the @file{Makefile} variable @code{top_builddir} in your +@file{Makefile.in}. Automake does this automatically, but Autoconf +users should set it to the relative path to the top of your build +directory (@file{../..}, for example).} @code{AM_PROG_LIBTOOL} was the +old name for this macro, and although supported at the moment is +deprecated. 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 @@ -1813,7 +1571,7 @@ libraries. You can modify these defaults by calling either the # Turn off shared libraries during beta-testing, since they # make the build process take too long. AC_DISABLE_SHARED -AM_PROG_LIBTOOL +AC_PROG_LIBTOOL @end example The user may specify modified forms of the configure flags @@ -1844,7 +1602,7 @@ use to automatically update the libtool script if it becomes out-of-date. In order to do that, add to your @file{configure.in}: @example -AM_PROG_LIBTOOL +AC_PROG_LIBTOOL AC_SUBST(LIBTOOL_DEPS) @end example @@ -1862,32 +1620,11 @@ on @file{libtool}. @end defmac -@defmac AC_LIBTOOL_CXX -Enable C++ shared library support. This macro should be used if libtool -will be used to generate C++ shared libraries. It causes a C++-specific -configuration to be appended to the @file{libtool} script. The C++ -support can coexist with other configurations, including the default C -shared library configuration. It is not necessary to invoke this macro -explicitly, as long as @code{AC_PROG_CXX} is called within the configure -script. -@end defmac - -@defmac AC_LIBTOOL_GCJ -Enable GCJ shared library support. This macro should be used if libtool -will be used to generate GCJ shared libraries. It causes a GCJ-specific -configuration to be appended to the @file{libtool} script. The GCJ -support can coexist with other configurations, including the default C -shared library configuration. It is not necessary to invoke this macro -explicitly, as long as @code{AM_PROG_GCJ} (or @code{AC_PROG_GCJ}, -whenever it is implemented in autoconf) is called within the configure -script. -@end defmac - @defmac AC_LIBTOOL_DLOPEN Enable checking for dlopen support. This macro should be used if the package makes use of the @samp{-dlopen} and @samp{-dlpreopen} flags, otherwise libtool will assume that the system does not support dlopening. -The macro must be called @strong{before} @code{AM_PROG_LIBTOOL}. +The macro must be called @strong{before} @code{AC_PROG_LIBTOOL}. @end defmac @defmac AC_LIBTOOL_WIN32_DLL @@ -1898,15 +1635,15 @@ are exported with @code{__declspec(dllexport)} and imported with assume that the package libraries are not dll clean and will build only static libraries on win32 hosts. -@code{AM_PROG_LIBTOOL} must be called @strong{after} this macro, and +This macro must be called @strong{before} @code{AC_PROG_LIBTOOL}, and provision must be made to pass @samp{-no-undefined} to @code{libtool} -in link mode from the package @code{Makefile}. Naturally, passing -@samp{-no-undefined} means that all the library symbols @strong{really are} -defined at link time! +in link mode from the package @code{Makefile}. Naturally, if you pass +@samp{-no-undefined}, you must ensure that all the library symbols +@strong{really are} defined at link time! @end defmac @defmac AC_DISABLE_FAST_INSTALL -Change the default behaviour for @code{AM_PROG_LIBTOOL} to disable +Change the default behaviour for @code{AC_PROG_LIBTOOL} to disable optimization for fast installation. The user may still override this default, depending on platform support, by specifying @samp{--enable-fast-install}. @@ -1914,23 +1651,94 @@ default, depending on platform support, by specifying @defmac AC_DISABLE_SHARED @defmacx AM_DISABLE_SHARED -Change the default behaviour for @code{AM_PROG_LIBTOOL} to disable +Change the default behaviour for @code{AC_PROG_LIBTOOL} to disable shared libraries. The user may still override this default by specifying @samp{--enable-shared}. @end defmac @defmac AC_DISABLE_STATIC @defmacx AM_DISABLE_STATIC -Change the default behaviour for @code{AM_PROG_LIBTOOL} to disable +Change the default behaviour for @code{AC_PROG_LIBTOOL} to disable static libraries. The user may still override this default by specifying @samp{--enable-static}. @end defmac +The tests in @code{AC_PROG_LIBTOOL} also recognize the following +environment variables: + +@defvar CC +The C compiler that will be used by the generated @code{libtool}. If +this is not set, @code{AC_PROG_LIBTOOL} will look for @code{gcc} or +@code{cc}. +@end defvar + +@defvar CFLAGS +Compiler flags used to generate standard object files. If this is not +set, @code{AC_PROG_LIBTOOL} will not use any such flags. It affects +only the way @code{AC_PROG_LIBTOOL} runs tests, not the produced +@code{libtool}. +@end defvar + +@defvar CPPFLAGS +C preprocessor flags. If this is not set, @code{AC_PROG_LIBTOOL} will +not use any such flags. It affects only the way @code{AC_PROG_LIBTOOL} +runs tests, not the produced @code{libtool}. +@end defvar + +@defvar LD +The system linker to use (if the generated @code{libtool} requires one). +If this is not set, @code{AC_PROG_LIBTOOL} will try to find out what is +the linker used by @var{CC}. +@end defvar + +@defvar LDFLAGS +The flags to be used by @code{libtool} when it links a program. If +this is not set, @code{AC_PROG_LIBTOOL} will not use any such flags. It +affects only the way @code{AC_PROG_LIBTOOL} runs tests, not the produced +@code{libtool}. +@end defvar + +@defvar LIBS +The libraries to be used by @code{AC_PROG_LIBTOOL} when it links a +program. If this is not set, @code{AC_PROG_LIBTOOL} will not use any +such flags. It affects only the way @code{AC_PROG_LIBTOOL} runs tests, +not the produced @code{libtool}. +@end defvar + +@defvar NM +Program to use rather than checking for @code{nm}. +@end defvar + +@defvar RANLIB +Program to use rather than checking for @code{ranlib}. +@end defvar + +@defvar LN_S +A command that creates a link of a program, a soft-link if possible, a +hard-link otherwise. @code{AC_PROG_LIBTOOL} will check for a suitable +program if this variable is not set. +@end defvar + +@defvar DLLTOOL +Program to use rather than checking for @code{dlltool}. Only meaningful +for Cygwin/MS-Windows. +@end defvar + +@defvar OBJDUMP +Program to use rather than checking for @code{objdump}. Only meaningful +for Cygwin/MS-Windows. +@end defvar + +@defvar AS +Program to use rather than checking for @code{as}. Only used on +Cygwin/MS-Windows at the moment. +@end defvar + @pindex aclocal When you invoke the @code{libtoolize} program (@pxref{Invoking libtoolize}), it will tell you where to find a definition of -@code{AM_PROG_LIBTOOL}. If you use Automake, the @code{aclocal} program -will automatically add @code{AM_PROG_LIBTOOL} support to your +@code{AC_PROG_LIBTOOL}. If you use Automake, the @code{aclocal} program +will automatically add @code{AC_PROG_LIBTOOL} support to your @code{configure} script. Nevertheless, it is advisable to include a copy of @file{libtool.m4} in @@ -1956,9 +1764,6 @@ Attempt to guess a canonical system name. @pindex config.sub Canonical system name validation subroutine script. -@item ltconfig -Generate a libtool script for a given system. - @item ltmain.sh @pindex ltmain.sh A generic script implementing basic libtool functionality. @@ -2000,7 +1805,7 @@ and accepts the following options: Work silently, and assume that Automake libtool support is used. @samp{libtoolize --automake} is used by Automake to add libtool files to -your package, when @code{AM_PROG_LIBTOOL} appears in your +your package, when @code{AC_PROG_LIBTOOL} appears in your @file{configure.in}. @item --copy @@ -2068,16 +1873,16 @@ Function Checks, The Autoconf Manual, autoconf, The Autoconf Manual}), and a few other functions. @end defvar -Unfortunately, the most recent version of Autoconf (2.12, at the time of +Unfortunately, the stable release of Autoconf (2.13, at the time of this writing) does not have any way for libtool to provide support for these variables. So, if you depend on them, use the following code immediately before the call to @code{AC_OUTPUT} in your @file{configure.in}: @example -LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.o/.lo/g'` +LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'` AC_SUBST(LTLIBOBJS) -LTALLOCA=`echo "$ALLOCA" | sed 's/\.o/.lo/g'` +LTALLOCA=`echo "$ALLOCA" | sed 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'` AC_SUBST(LTALLOCA) AC_OUTPUT(@dots{}) @end example @@ -2096,9 +1901,9 @@ AC_OUTPUT(@dots{}) When you are developing a package, it is often worthwhile to configure your package with the @samp{--disable-shared} flag, or to override the -defaults for @code{AM_PROG_LIBTOOL} by using the -@code{AM_DISABLE_SHARED} Autoconf macro (@pxref{AM_PROG_LIBTOOL, , The -@code{AM_PROG_LIBTOOL} macro}). This prevents libtool from building +defaults for @code{AC_PROG_LIBTOOL} by using the +@code{AC_DISABLE_SHARED} Autoconf macro (@pxref{AC_PROG_LIBTOOL, , The +@code{AC_PROG_LIBTOOL} macro}). This prevents libtool from building shared libraries, which has several advantages: @itemize @bullet @@ -2439,56 +2244,67 @@ safely installed in a system directory. Here are the relevant portions of that file: @example -/* __BEGIN_DECLS should be used at the beginning of your declarations, - so that C++ compilers don't mangle their names. Use __END_DECLS at +/* BEGIN_C_DECLS should be used at the beginning of your declarations, + so that C++ compilers don't mangle their names. Use END_C_DECLS at the end of C declarations. */ -#undef __BEGIN_DECLS -#undef __END_DECLS +#undef BEGIN_C_DECLS +#undef END_C_DECLS #ifdef __cplusplus -# define __BEGIN_DECLS extern "C" @{ -# define __END_DECLS @} +# define BEGIN_C_DECLS extern "C" @{ +# define END_C_DECLS @} #else -# define __BEGIN_DECLS /* empty */ -# define __END_DECLS /* empty */ +# define BEGIN_C_DECLS /* empty */ +# define END_C_DECLS /* empty */ #endif -/* __P is a macro used to wrap function prototypes, so that compilers - that don't understand ANSI C prototypes still work, and ANSI C - compilers can issue warnings about type mismatches. */ -#undef __P +/* PARAMS is a macro used to wrap function prototypes, so that + compilers that don't understand ANSI C prototypes still work, + and ANSI C compilers can issue warnings about type mismatches. */ +#undef PARAMS #if defined (__STDC__) || defined (_AIX) \ || (defined (__mips) && defined (_SYSTYPE_SVR4)) \ || defined(WIN32) || defined(__cplusplus) -# define __P(protos) protos +# define PARAMS(protos) protos #else -# define __P(protos) () +# define PARAMS(protos) () #endif @end example These macros are used in @file{foo.h} as follows: @example -#ifndef _FOO_H_ -#define _FOO_H_ 1 +#ifndef FOO_H +#define FOO_H 1 /* The above macro definitions. */ -@dots{} +#include "@dots{}" + +BEGIN_C_DECLS + +int foo PARAMS((void)); +int hello PARAMS((void)); -__BEGIN_DECLS -int foo __P((void)); -int hello __P((void)); -__END_DECLS +END_C_DECLS -#endif /* !_FOO_H_ */ +#endif /* !FOO_H */ @end example -Note that the @file{#ifndef _FOO_H_} prevents the body of @file{foo.h} +Note that the @file{#ifndef FOO_H} prevents the body of @file{foo.h} from being read more than once in a given compilation. -Feel free to copy the definitions of @code{__P}, @code{__BEGIN_DECLS}, -and @code{__END_DECLS} into your own headers. Then, you may use them to +Also the only thing that must go outside the +@code{BEGIN_C_DECLS}/@code{END_C_DECLS} pair are @code{#include} lines. +Strictly speaking it is only C symbol names that need to be protected, +but your header files will be more maintainable if you have a single +pair of of these macros around the majority of the header contents. + +You should use these definitions of @code{PARAMS}, @code{BEGIN_C_DECLS}, +and @code{END_C_DECLS} into your own headers. Then, you may use them to create header files that are valid for C++, ANSI, and non-ANSI -compilers. +compilers@footnote{We used to recommend @code{__P}, +@code{__BEGIN_DECLS} and @code{__END_DECLS}. This was bad advice since +symbols (even preprocessor macro names) that begin with an underscore +are reserved for the use of the compiler.}. Do not be naive about writing portable code. Following the tips given above will help you miss the most obvious problems, but there are @@ -2501,8 +2317,8 @@ Pre-ANSI compilers do not always support the @code{void *} generic pointer type, and so need to use @code{char *} in its place. @item -The @code{const} and @code{signed} keywords are not supported by some -compilers, especially pre-ANSI compilers. +The @code{const}, @code{inline} and @code{signed} keywords are not +supported by some compilers, especially pre-ANSI compilers. @item The @code{long double} type is not supported by many compilers. @@ -2606,7 +2422,7 @@ As of version @value{VERSION}, libtool provides support for dlopened modules. However, you should indicate that your package is willing to use such support, by using the macro @samp{AC_LIBTOOL_DLOPEN} in @file{configure.in}. If this macro is not used (or it is used -@emph{after} @samp{AM_PROG_LIBTOOL}), libtool will assume no dlopening +@emph{after} @samp{AC_PROG_LIBTOOL}), libtool will assume no dlopening mechanism is available, and will try to simulate it. This chapter discusses how you as a dlopen application developer might @@ -2821,9 +2637,9 @@ libltdl is licensed under the terms of the GNU Library General Public License, with the following exception: @quotation -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. @end quotation @@ -2928,8 +2744,9 @@ following search paths for the module (in the order as follows): @enumerate 1 @item user-defined search path: -This search path can be set by the program using the -functions @code{lt_dlsetsearchpath} and @code{lt_dladdsearchdir}. +This search path can be changed by the program using the +functions @code{lt_dlsetsearchpath}, @code{lt_dladdsearchdir} and +@code{lt_dlinsertsearchdir}. @item libltdl's search path: This search path is the value of the environment variable @@ -2972,9 +2789,9 @@ then the module is unloaded. Return 0 on success. @end deftypefun -@deftypefun lt_ptr_t lt_dlsym (lt_dlhandle @var{handle}, const char *@var{name}) +@deftypefun lt_ptr lt_dlsym (lt_dlhandle @var{handle}, const char *@var{name}) Return the address in the module @var{handle}, where the symbol given -by the null terminated string @var{name} is loaded. +by the null-terminated string @var{name} is loaded. If the symbol cannot be found, @code{NULL} is returned. @end deftypefun @@ -3003,7 +2820,7 @@ macro @code{LTDL_SET_PRELOADED_SYMBOLS}. Return 0 on success. @end deftypefun -@defmac LTDL_SET_PRELOADED_SYMBOLS() +@defmac LTDL_SET_PRELOADED_SYMBOLS Set the default list of preloaded symbols. Should be used in your program to initialize libltdl's list of preloaded modules. @@ -3020,8 +2837,15 @@ int main() @{ @end defmac @deftypefun int lt_dladdsearchdir (const char *@var{search_dir}) -Add the search directory @var{search_dir} to the user-defined library -search path. Return 0 on success. +Append the search directory @var{search_dir} to the current user-defined +library search path. Return 0 on success. +@end deftypefun + +@deftypefun int lt_dlinsertsearchdir (@w{const char *@var{before}}, @w{const char *@var{search_dir}}) +Insert the search directory @var{search_dir} into the user-defined library +search path, immediately before the element starting at address +@var{before}. If @var{before} is @samp{NULL}, then @var{search_dir} is +appending as if @code{lt_dladdsearchdir} had been called. Return 0 on success. @end deftypefun @deftypefun int lt_dlsetsearchpath (const char *@var{search_path}) @@ -3034,6 +2858,25 @@ directories. Return 0 on success. Return the current user-defined library search path. @end deftypefun +@deftypefun int lt_dlforeachfile (@w{const char *@var{search_path}}, @w{int (*@var{func}) (const char *@var{filename}, lt_ptr @var{data})}, @w{lt_ptr @var{data}}) +In some applications you may not want to load individual modules with +known names, but rather find all of the modules in a set of +directories and load them all during initialisation. With this function +you can have libltdl scan the colon delimited directory list in +@var{search_path} for candidates, and pass them, along with @var{data} +to your own callback function, @var{func}. If @var{seach_path} is +@samp{NULL}, then search all of the standard locations that +@code{lt_dlopen} would examine. This function will continue to make +calls to @var{func} for each file that it discovers in @var{search_path} +until one of these calls returns non-zero, or until the files are +exhausted. @samp{lt_dlforeachfile} returns value returned by the last +call made to @var{func}. + +For example you could define @var{func} to build an ordered +@dfn{argv}-like vector of files using @var{data} to hold the address of +the start of the vector. +@end deftypefun + @deftypefun int lt_dlmakeresident (lt_dlhandle @var{handle}) Mark a module so that it cannot be @samp{lt_dlclose}d. This can be useful if a module implements some core functionality in your project, @@ -3109,7 +2952,7 @@ int _foo1_helper() @{ /* an exported function */ int foo() @{ - return _foo_helper(); + return _foo1_helper(); @} @end example @@ -3178,11 +3021,11 @@ must be valid non-@code{NULL} function addresses, or else all @node User defined module data @section Data associated with loaded modules - + Some of the internal information about each loaded module that is maintained by libltdl is available to the user, in the form of this structure: - + @deftypefn {Type} {struct} lt_dlinfo @{ @w{char *@var{filename};} @w{char *@var{name};} @w{int @var{ref_count};} @} @code{lt_dlinfo} is used to store information about a module. The @var{filename} attribute is a null-terminated character string of @@ -3192,20 +3035,20 @@ the real module file name. If the module is a libtool module then @var{ref_count} attribute is a reference counter that describes how often the same module is currently loaded. @end deftypefn - + The following function will return a pointer to libltdl's internal copy of this structure for the given @var{handle}: - + @deftypefun {const lt_dlinfo *} lt_dlgetinfo (@w{lt_dlhandle @var{handle}}) Return a pointer to a struct that contains some information about the module @var{handle}. The contents of the struct must not be modified. Return @code{NULL} on failure. @end deftypefun - + Furthermore, in order to save you from having to keep a list of the handles of all the modules you have loaded, these functions allow you to iterate over libltdl's list of loaded modules: - + @deftypefun int lt_dlforeach (@w{int (*@var{func}) (lt_dlhandle @var{handle}, lt_ptr @var{data})}, @w{lt_ptr @var{data}}) For each loaded module call the function @var{func}. The argument @var{handle} is the handle of one of the loaded modules, @var{data} is @@ -3221,7 +3064,7 @@ list if @var{place} is @code{NULL}, and the next one on subsequent calls. If @var{place} is the last element in the list of loaded modules, this function returns @code{NULL}. @end deftypefun - + Of course, you would still need to maintain your own list of loaded module handles to parallel the list maintained by libltdl if there are any other data that you need to associate with each handle for the @@ -3232,25 +3075,25 @@ must first obtain a unique caller id from libltdl which you subsequently use to retrieve the data you stored earlier. This allows for different libraries that each wish to store their own data against loaded modules to do so without interfering with one another's data. - + @deftp {Type} lt_dlcaller_id The opaque type used to hold individual data set keys. @end deftp - + @deftypefun lt_dlcaller_id lt_dlcaller_register (void) Use this to obtain a unique key to store and retrieve individual sets of per module data. @end deftypefun - + @deftypefun lt_ptr lt_dlcaller_set_data (@w{lt_dlcaller_id @var{key}}, @w{lt_dlhandle @var{handle}}, @w{lt_ptr @var{data}}) Set @var{data} as the set of data uniquely associated with @var{key} and @var{handle} for later retrieval. This function returns the @var{data} previously associated with @var{key} and @var{handle} if any. A result of 0, may indicate that a diagnostic for the last error (if any) is available from @code{lt_dlerror()}. - + For example, to correctly remove some associated data: - + @example lt_ptr stale = lt_dlcaller_set_data (key, handle, 0); if (stale == NULL) @@ -3269,7 +3112,7 @@ For example, to correctly remove some associated data: @} @end example @end deftypefun - + @deftypefun lt_ptr lt_dlcaller_get_data (@w{lt_dlcaller_id @var{key}}, @w{lt_dlhandle @var{handle}}) Return the address of the data associated with @var{key} and @var{handle}, or else @code{NULL} if there is none. @@ -3284,9 +3127,9 @@ int my_dlcaller_callback (lt_dlhandle handle, lt_ptr key_ptr) @{ struct my_module_data *my_data; - + my_data = lt_dlcaller_get_data (handle, (lt_dlcaller_id) *key_ptr); - + return process (my_data); @} @@ -3297,6 +3140,7 @@ my_dlcaller_foreach (lt_dlcaller_id key) @} @end example + @node Module loaders for libltdl @section How to create and register new module loaders @@ -3315,15 +3159,15 @@ which they can be allocated to an instance of @code{lt_user_dlloader} and registered. Registering the loader requires that you choose a name for it, so that it -can be recognised by @code{lt_find_dlloader} and removed with -@code{lt_remove_dlloader}. The name you choose must be unique, and not +can be recognised by @code{lt_dlloader_find} and removed with +@code{lt_dlloader_remove}. The name you choose must be unique, and not already in use by libltdl's builtin loaders: @table @asis @item "dlopen" The system dynamic library loader, if one exists. @item "dld" -The @sc{gnu} dld loader, if @file{libdld} wasinstalled when libltdl was +The @sc{gnu} dld loader, if @file{libdld} was installed when libltdl was built. @item "dlpreload" The loader for @code{lt_dlopen}ing of preloaded static modules. @@ -3335,32 +3179,41 @@ libltdl, so you should not use that for your own loader names. @noindent The following types are defined in @file{ltdl.h}: -@deftp {Type} lt_module_t -@code{lt_module_t} is a dlloader dependent module. +@deftp {Type} lt_module +@code{lt_module} is a dlloader dependent module. The dynamic module loader extensions communicate using these low level types. @end deftp -@deftp {Type} lt_dlloader_t -@code{lt_dlloader_t} is a handle for module loader types. +@deftp {Type} lt_dlloader +@code{lt_dlloader} is a handle for module loader types. +@end deftp + +@deftp {Type} lt_user_data +@code{lt_user_data} is used for specifying loader instance data. @end deftp -@deftypefn {Type} {struct} lt_user_dlloader @{@w{const char *@var{sym_prefix};} @w{lt_module_open_t *@var{module_open};} @w{lt_module_close_t *@var{module_close};} @w{lt_find_sym_t *@var{find_sym};} @w{lt_dlloader_exit_t *@var{dlloader_exit};} @} +@deftypefn {Type} {struct} lt_user_dlloader @{@w{const char *@var{sym_prefix};} @w{lt_module_open *@var{module_open};} @w{lt_module_close *@var{module_close};} @w{lt_find_sym *@var{find_sym};} @w{lt_dlloader_exit *@var{dlloader_exit};} @} If you want to define a new way to open dynamic modules, and have the @code{lt_dlopen} @sc{api} use it, you need to instantiate one of these -structures and pass it to @code{lt_add_dlloader}. +structures and pass it to @code{lt_dlloader_add}. You can pass whatever +you like in the @var{dlloader_data} field, and it will be passed back as +the value of the first parameter to each of the functions specified in +the function pointer fields. @end deftypefn -@deftypefn {Type} lt_module_t lt_module_open_t (@w{const char *@var{filename}}) -The type of the loader function for an @code{lt_dlloader_t} module -loader. Implementation of such a function should attempt to load the -named module, and return an @code{lt_module_t} suitable for passing in -to the associated @code{lt_module_close_t} and @code{lt_sym_find_t} -function pointers. If the function fails it should return NULL, and set -the error message with @code{lt_dlseterror}. +@deftypefn {Type} lt_module lt_module_open (@w{const char *@var{filename}}) +The type of the loader function for an @code{lt_dlloader} module +loader. The value set in the dlloader_data field of the @code{struct +lt_user_dlloader} structure will be passed into this function in the +@var{loader_data} parameter. Implementation of such a function should +attempt to load the named module, and return an @code{lt_module} +suitable for passing in to the associated @code{lt_module_close} and +@code{lt_sym_find} function pointers. If the function fails it should +return @code{NULL}, and set the error message with @code{lt_dlseterror}. @end deftypefn -@deftypefn {Type} int lt_module_close_t (@w{lt_module_t @var{module}}) +@deftypefn {Type} int lt_module_close (@w{lt_user_data @var{loader_data},} @w{lt_module @var{module}}) The type of the unloader function for a user defined module loader. Implementatation of such a function should attempt to release any resources tied up by the @var{module} module, and then unload it @@ -3368,18 +3221,20 @@ from memory. If the function fails for some reason, set the error message with @code{lt_dlseterror} and return non-zero. @end deftypefn -@deftypefn {Type} lt_ptr_t lt_find_sym_t (@w{lt_module_t @var{module},} @w{const char *@var{symbol}}) +@deftypefn {Type} lt_ptr lt_find_sym (@w{lt_module @var{module},} @w{const char *@var{symbol}}) The type of the symbol lookup function for a user defined module loader. Implementation of such a function should return the address of the named @var{symbol} in the module @var{module}, or else set the error message -with @code{lt_dlseterror} and return NULL if lookup fails. +with @code{lt_dlseterror} and return @code{NULL} if lookup fails. @end deftypefn -@deftypefn {Type} int lt_dlloader_exit_t (void) +@deftypefn {Type} int lt_dlloader_exit (@w{lt_user_data @var{loader_data}}) The type of the finalisation function for a user defined module loader. Implementation of such a function should free any resources associated -with the loader. If non-NULL, the function will be called by -@code{lt_dlexit}. +with the loader, including any user specified data in the +@code{dlloader_data} field of the @code{lt_user_dlloader}. If non-@code{NULL}, +the function will be called by @code{lt_dlexit}, and +@code{lt_dlloader_remove}. @end deftypefn For example: @@ -3399,9 +3254,10 @@ register_myloader (void) dlloader.module_close = myloader_close; dlloader.find_sym = myloader_find_sym. dlloader.dlloader_exit = myloader_exit; + dlloader.dlloader_data = (lt_user_data)myloader_function; /* Add my loader as the default module loader. */ - if (lt_add_dlloader (lt_next_dlloader (NULL), &dlloader, "myloader") != 0) + if (lt_dlloader_add (lt_dlloader_next (NULL), &dlloader, "myloader") != 0) return ERROR; return OK; @@ -3421,25 +3277,25 @@ during the initialisation phase. libltdl provides the following functions for writing your own module loaders: -@deftypefun int lt_add_dlloader (@w{lt_dlloader_t *@var{place},} @w{lt_user_dlloader *@var{dlloader},} @w{const char *@var{loader_name}}) +@deftypefun int lt_dlloader_add (@w{lt_dlloader *@var{place},} @w{lt_user_dlloader *@var{dlloader},} @w{const char *@var{loader_name}}) Add a new module loader to the list of all loaders, either as the last loader (if @var{place} is @code{NULL}), else immediately before the loader passed as @var{place}. @var{loader_name} will be returned by @code{lt_dlloader_name} if it is subsequently passed a newly registered loader. These @var{loader_name}s must be unique, or -@code{lt_remove_dlloader} and @code{lt_find_dlloader} cannot +@code{lt_dlloader_remove} and @code{lt_dlloader_find} cannot work. Returns 0 for success. @example @{ /* Make myloader be the last one. */ - if (lt_add_dlloader (NULL, myloader) != 0) + if (lt_dlloader_add (NULL, myloader) != 0) perror (lt_dlerror ()); @} @end example @end deftypefun -@deftypefun int lt_remove_dlloader (@w{const char *@var{loader_name}}) +@deftypefun int lt_dlloader_remove (@w{const char *@var{loader_name}}) Remove the loader identified by the unique name, @var{loader_name}. Before this can succeed, all modules opened by the named loader must have been closed. Returns 0 for success, otherwise an error message can @@ -3448,31 +3304,31 @@ be obtained from @code{lt_dlerror}. @example @{ /* Remove myloader. */ - if (lt_remove_dlloader ("myloader") != 0) + if (lt_dlloader_remove ("myloader") != 0) perror (lt_dlerror ()); @} @end example @end deftypefun -@deftypefun lt_dlloader_t *lt_next_dlloader (@w{lt_dlloader_t *@var{place}}) +@deftypefun {lt_dlloader *}lt_dlloader_next (@w{lt_dlloader *@var{place}}) Iterate over the module loaders, returning the first loader if @var{place} is @code{NULL}, and the next one on subsequent calls. The handle is for use with -@code{lt_add_dlloader}. +@code{lt_dlloader_add}. @example @{ /* Make myloader be the first one. */ - if (lt_add_dlloader (lt_next_dlloader (NULL), myloader) != 0) + if (lt_dlloader_add (lt_dlloader_next (NULL), myloader) != 0) return ERROR; @} @end example @end deftypefun -@deftypefun lt_dlloader_t *lt_find_dlloader (@w{const char *@var{loader_name}}) +@deftypefun {lt_dlloader *}lt_dlloader_find (@w{const char *@var{loader_name}}) Return the first loader with a matching @var{loader_name} identifier, or else @code{NULL}, if the identifier is not found. -The identifiers which may be used by ltdl itself, if the host +The identifiers which may be used by libltdl itself, if the host architecture supports them are @dfn{dlopen}@footnote{This is used for the host dependent module loading @sc{api} -- @code{shl_load} and @code{LoadLibrary} for example}, @dfn{dld} and @dfn{dlpreload}. @@ -3481,19 +3337,26 @@ the host dependent module loading @sc{api} -- @code{shl_load} and @{ /* Add a user loader as the next module loader to be tried if the standard dlopen loader were to fail when lt_dlopening. */ - if (lt_add_dlloader (lt_find_dlloader ("dlopen"), myloader) != 0) + if (lt_dlloader_add (lt_dlloader_find ("dlopen"), myloader) != 0) return ERROR; @} @end example @end deftypefun -@deftypefun char *lt_dlloader_name (@w{lt_dlloader_t *@var{place}}) +@deftypefun {const char *}lt_dlloader_name (@w{lt_dlloader *@var{place}}) Return the identifying name of @var{PLACE}, as obtained from -@code{lt_next_dlloader} or @code{lt_find_dlloader}. If this function fails, +@code{lt_dlloader_next} or @code{lt_dlloader_find}. If this function fails, it will return @code{NULL} and set an error for retrieval with @code{lt_dlerror}. @end deftypefun +@deftypefun {lt_user_data *}lt_dlloader_data (@w{lt_dlloader *@var{place}}) +Return the address of the @code{dlloader_data} of @var{PLACE}, as +obtained from @code{lt_dlloader_next} or @code{lt_dlloader_find}. If +this function fails, it will return @code{NULL} and set an error for +retrieval with @code{lt_dlerror}. +@end deftypefun + @subsection Error handling within user module loaders @deftypefun int lt_dladderror (@w{const char *@var{diagnostic}}) @@ -3534,7 +3397,7 @@ In this case, you must decide whether to manually add the @code{ltdl} objects to your package, or else which flavor of libltdl you want to use: a convenience library or an installable libtool library. -The most simplistic way to add @code{ltdl} to your package is to copy +The most simplistic way to add @code{libltdl} to your package is to copy the source files, @file{ltdl.c} and @file{ltdl.h}, to a source directory withing your package and to build and link them along with the rest of your sources. To help you do this, the m4 macros for autoconf are @@ -3564,11 +3427,11 @@ symbols. In general you can safely use the convenience library in programs which don't depend on other libraries that might use libltdl too. In order to enable this flavor of libltdl, you should add the line @samp{AC_LIBLTDL_CONVENIENCE} to your @file{configure.in}, -@emph{before} @samp{AM_PROG_LIBTOOL}. +@emph{before} @samp{AC_PROG_LIBTOOL}. In order to select the installable version of libltdl, you should add a call of the macro @samp{AC_LIBLTDL_INSTALLABLE} to your -@file{configure.in} @emph{before} @samp{AM_PROG_LIBTOOL}. This macro +@file{configure.in} @emph{before} @samp{AC_PROG_LIBTOOL}. This macro will check whether libltdl is already installed and, if not, request the libltdl embedded in your package to be built and installed. Note, however, that no version checking is performed. The user may override @@ -3581,7 +3444,7 @@ the @code{libtoolize} command line. It will copy the libltdl sources to a subdirectory @samp{libltdl} in your package. Both macros accept an optional argument to specify the location of the @samp{libltdl} directory. By the default both macros assume that it -is @samp{$@{top_builddir@}/libltdl}. +is @samp{$@{top_srcdir@}/libltdl}. Whatever macro you use, it is up to you to ensure that your @file{configure.in} will configure libltdl, using @@ -3589,35 +3452,35 @@ Whatever macro you use, it is up to you to ensure that your sub-makes within libltdl's directory, using automake's @var{SUBDIRS}, for example. Both macros define the shell variables @var{LIBLTDL}, to the link flag that you should use to link with libltdl, and -@var{INCLTDL}, to the preprocessor flag that you should use to compile +@var{LTDLINCL}, to the preprocessor flag that you should use to compile with programs that include @file{ltdl.h}. It is up to you to use @samp{AC_SUBST} to ensure that this variable will be available in @file{Makefile}s, or add them to variables that are @samp{AC_SUBST}ed by default, such as @var{LIBS} and @var{CPPFLAGS}. If you're using the convenience libltdl, @var{LIBLTDL} will be the -pathname for the convenience version of libltdl and @var{INCLTDL} will be +pathname for the convenience version of libltdl and @var{LTDLINCL} will be @samp{-I} followed by the directory that contains libltdl, both starting -with @samp{$@{top_builddir@}/}. +with @samp{$@{top_builddir@}/} or @samp{$@{top_srcdir@}/}, respectively. If you request an installed version of libltdl and one is found@footnote{Even if libltdl is installed, @samp{AC_LIBLTDL_INSTALLABLE} may fail to detect it, if libltdl depends on symbols provided by libraries other than the C library. In this case, it will needlessly build and install libltdl.}, @var{LIBLTDL} will -be set to @samp{-lltdl} and @var{INCLTDL} will be empty (which is just a +be set to @samp{-lltdl} and @var{LTDLINCL} will be empty (which is just a blind assumption that @file{ltdl.h} is somewhere in the include path if libltdl is in the library path). If an installable version of libltdl must be built, its pathname, starting with @samp{$@{top_builddir@}/}, -will be stored in @var{LIBLTDL}, and @var{INCLTDL} will be set just like +will be stored in @var{LIBLTDL}, and @var{LTDLINCL} will be set just like in the case of convenience library. So, when you want to link a program with libltdl, be it a convenience, -installed or installable library, just compile with @samp{$(INCLTDL)} +installed or installable library, just compile with @samp{$(LTDLINCL)} and link it with @samp{$(LIBLTDL)}, using libtool. You should probably also add @samp{AC_LIBTOOL_DLOPEN} to your -@file{configure.in} @emph{before} @samp{AM_PROG_LIBTOOL}, otherwise +@file{configure.in} @emph{before} @samp{AC_PROG_LIBTOOL}, otherwise libtool will assume no dlopening mechanism is supported, and revert to dlpreopening, which is probably not what you want. @@ -3636,13 +3499,13 @@ configure.in: dnl Enable building of the convenience library dnl and set LIBLTDL accordingly AC_LIBLTDL_CONVENIENCE -dnl Substitute INCLTDL and LIBLTDL in the Makefiles -AC_SUBST(INCLTDL) +dnl Substitute LTDLINCL and LIBLTDL in the Makefiles +AC_SUBST(LTDLINCL) AC_SUBST(LIBLTDL) dnl Check for dlopen support AC_LIBTOOL_DLOPEN dnl Configure libtool -AM_PROG_LIBTOOL +AC_PROG_LIBTOOL dnl Configure libltdl AC_CONFIG_SUBDIRS(libltdl) ... @@ -3653,12 +3516,12 @@ Makefile.am: ... SUBDIRS = libltdl -INCLUDES = $(INCLTDL) +INCLUDES = $(LTDLINCL) myprog_LDFLAGS = -export-dynamic -# The quotes around -dlopen below fool automake into accepting it -myprog_LDADD = $(LIBLTDL) "-dlopen" self "-dlopen" libfoo.la -myprog_DEPENDENCIES = $(LIBLTDL) libfoo.la +# The quotes around -dlopen below fool automake <= 1.4 into accepting it +myprog_LDADD = $(LIBLTDL) "-dlopen" self "-dlopen" foo1.la +myprog_DEPENDENCIES = $(LIBLTDL) foo1.la ... @end example @@ -3677,101 +3540,9 @@ This chapter describes how libtool interacts with other languages, and what special considerations you need to make if you do not use C. @menu -* Configuration tags:: * C++ libraries:: @end menu -@node Configuration tags -@section Configuration tags -@cindex Configuration tags -@cindex tags - -A single libtool script may support multiple configurations. By -default, it will only support C compilation, but additional -configuration tags can be created, using @samp{ltconfig --add-tag}, so -that libtool can support other compilers. Such configuration tags can -be used to select native compilers instead of cross ones, or compilers -of other languages. - -For example, in order to create a tag for a C++ compiler @samp{CC}, you -could run: - -@example -$ @kbd{LTCC=gcc CC=c++ CFLAGS=-g CPPFLAGS=-Dfoo \} -> @kbd{./ltconfig -o libtool --add-tag=CXX ltcf-cxx.sh} -@end example - -@samp{ltcf-cxx.sh} is a shell script fragment that configures C++ -specific variables that get placed within the appended configuration -tag. Another shell script called @samp{ltcf-c.sh} that contains C -compiler configurations also exists but it should not be used by the -user. It is used internally by the ltconfig script. - -Note that you should set @var{LTCC} to a valid C compiler, because -libtool may need to compile additional C sources internally. Note also -that, although @samp{CC} is not a C compiler, you should use variables -such as @var{CC}, @var{CFLAGS} and @var{CPPFLAGS} to tell libtool which -flags to use when compiling test programs. - -You can use existing compiler/language specific shell script fragments, -such as @samp{ltcf-cxx.sh}, as a reference for other compilers/languages -you would like libtool to support. - -A potential problem may occur if you use variables when setting -@var{LTCC} and @var{CC}. For example, a problem will occur if you do -the following: - -@example -$ @kbd{LTCC=$CC CC=$CXX ./ltconfig -o libtool --add-tag=CXX ltcf-cxx.sh} -@end example - -In this example, @var{CC} is set to the C++ compiler and LTCC is set to -the compiler pointed to by @var{$CC}. However, @var{CC} was previously -set to the C++ compiler @var{$CXX}, which causes LTCC to be set to the -C++ compiler @var{$CXX}, too. This is a problem because LTCC must be a -valid C compiler, not a C++ compiler for example. - -If @samp{ltconfig} is unable to determine the host type then you must -explicitly provide a host when invoking @samp{ltconfig}. This is -typically necessary for new very platforms and many cross-compiled -platforms. For example, assuming that your host is @samp{i386-nto} then -@samp{ltconfig} could be invoked as follows: - -@example -$ @kbd{LTCC=$CC CC=$CXX ./ltconfig -o libtool \} -> @kbd{--add-tag=CXX ltcf-cxx.sh i386-nto} -@end example - -After a configuration tag has been added using the @samp{--add-tag} -option, whenever you want to compile or link a library using -@samp{c++}, you should run: - -@example -$ @kbd{./libtool --mode=compile c++ -c test.cc} -@end example - -Libtool will automatically detect the appropriate tagged configuration -to use by matching the compiler used in the above command with the one -the tagged configuration was configured with. - -The tagged configuration that libtool uses can be explicitly specified -by using the @samp{--tag} option as follows: - -@example -$ @kbd{./libtool --tag=CXX --mode=compile c++ -c test.cc} -@end example - -Conceptually, tags are cumulative, i.e., they could only set a couple of -configuration variables, leaving others untouched. In practice, any tag -created with ltconfig will override all libtool configuration variables. -Only the two pre-defined tags, @samp{disable-shared} and -@samp{disable-static}, override a single variable, and can be used -cumulatively, after other tags. - -@emph{NOTE}: C++ support may be automatically added to your package by -adding the @code{AC_LIBTOOL_CXX} macro to your package -@file{configure.in} file. - @node C++ libraries @section Writing libraries for C++ @c FIXME: in the TOC, the ++ is too large (seems to be math mode) @@ -3779,11 +3550,6 @@ adding the @code{AC_LIBTOOL_CXX} macro to your package @cindex pitfalls using C++ @cindex C++, pitfalls -@emph{NOTE}: The problems described in this section may no longer -relevant due to the @samp{libtool} multi-language support. To enable -C++ support in libtool, use the @code{AC_LIBTOOL_CXX} macro in your -@file{configure.in} file. - Creating libraries of C++ code should be a fairly straightforward process, because its object files differ from C ones in only three ways: @@ -4023,33 +3789,6 @@ static and shared libraries, @file{mdemo-static.test} builds only static libraries (@samp{--disable-shared}), and @file{mdemo-shared.test} builds only shared libraries (@samp{--disable-static}). -@item tagdemo-conf.test -@itemx tagdemo-exec.test -@itemx tagdemo-make.test -@itemx tagdemo-static.test -@itemx tagdemo-shared.test -@pindex tagdemo-conf.test -@pindex tagdemo-exec.test -@pindex tagdemo-make.test -@pindex tagdemo-static.test -@pindex tagdemo-shared.test -These programs check to see that the @file{tagdemo} subdirectory of the -libtool distribution can be configured and built correctly. - -The @file{tagdemo} subdirectory contains a demonstration of a package -that uses libtool and its tagged configuration support -(@pxref{Configuration tags}) build a C++ library. C++ shared library -support is enabled by using the @code{AC_LIBTOOL_CXX} macro in -@file{tagdemo/configure.in}. - -The tests @file{tagdemo-make.test}, and @file{tagdemo-exec.test}, are -executed three times, under three different libtool configurations: -@file{tagdemo-conf.test} configures @file{tagdemo/libtool} to build both -static and shared libraries, @file{tagdemo-static.test} builds only -static libraries (@samp{--disable-shared}), and -@file{tagdemo-shared.test} builds only shared libraries -(@samp{--disable-static}). - @item dryrun.test @pindex dryrun.test This test checks whether libtool's @code{--dry-run} mode works properly. @@ -4143,7 +3882,7 @@ Finally, send a bug report to @value{BUGADDR} with any appropriate the details needed to reproduce the bug, and a brief description of why you think the behaviour is a bug. Be sure to include the word ``libtool'' in the subject line, as well as the version number you are -using (which can be found by typing @kbd{ltconfig --version}). +using (which can be found by typing @kbd{libtool --version}). @node Maintaining @chapter Maintenance notes for libtool @@ -4217,8 +3956,8 @@ usually willing to volunteer to help you with new ports, so you can send the information to them. To do the port yourself, you'll definitely need to modify the -@code{ltconfig} script in order to make platform-specific changes to the -configuration process. You should search the script for the +@code{libtool.m4} macros in order to make platform-specific changes to +the configuration process. You should search that file for the @code{PORTME} keyword, which will give you some hints on what you'll need to change. In general, all that is involved is modifying the appropriate configuration variables (@pxref{libtool script contents}). @@ -4227,8 +3966,8 @@ Your best bet is to find an already-supported system that is similar to yours, and make your changes based on that. In some cases, however, your system will differ significantly from every other supported system, and it may be necessary to add new configuration variables, and modify -the @code{ltmain.sh} script accordingly. Be sure to write to the -mailing list before you make changes to @code{ltmain.sh}, since they may +the @code{ltmain.in} script accordingly. Be sure to write to the +mailing list before you make changes to @code{ltmain.in}, since they may have advice on the most effective way of accomplishing what you want. @node Porting inter-library dependencies @@ -4241,7 +3980,7 @@ inter-library dependency on some platforms, thanks to a patch by Toshio Kuratomi @email{badger@@prtr-13.ucsc.edu}. Here's a shortened version of the message that contained his patch: -The basic architecture is this: in @file{ltconfig.in}, the person who +The basic architecture is this: in @file{libtool.m4}, the person who writes libtool makes sure @samp{$deplibs} is included in @samp{$archive_cmds} somewhere and also sets the variable @samp{$deplibs_check_method}, and maybe @samp{$file_magic_cmd} when @@ -4255,8 +3994,8 @@ writes libtool makes sure @samp{$deplibs} is included in @vindex file_magic_test_file looks in the library link path for libraries that have the right libname. Then it runs @samp{$file_magic_cmd} on the library and checks -for a match against @samp{regex} using @code{egrep}. When -@var{file_magic_test_file} is set in @file{ltconfig}, it is used as an +for a match against @var{regex} using @code{egrep}. When +@var{file_magic_test_file} is set by @file{libtool.m4}, it is used as an argument to @samp{$file_magic_cmd} in order to verify whether the regular expression matches its output, and warn the user otherwise. @@ -4282,7 +4021,7 @@ deplibs used unless needed. @item unknown @vindex unknown -is the default for all systems unless overridden in @file{ltconfig.in}. +is the default for all systems unless overridden in @file{libtool.m4}. It is the same as @samp{none}, but it documents that we really don't know what the correct value should be, and we welcome patches that improve it. @@ -4403,10 +4142,10 @@ they are bundled with: @table @code @item aix3* @itemx aix4* -AIX compilers have no PIC flags, since AIX has been ported only to -PowerPC and RS/6000 chips. @footnote{All code compiled for the PowerPC -and RS/6000 chips (@code{powerpc-*-*}, @code{powerpcle-*-*}, and -@code{rs6000-*-*}) is position-independent, regardless of the operating +Most AIX compilers have no PIC flags, since AIX (with the exception of +AIX for IA-64) runs on PowerPC and RS/6000 chips. @footnote{All code compiled +for the PowerPC and RS/6000 chips (@code{powerpc-*-*}, @code{powerpcle-*-*}, +and @code{rs6000-*-*}) is position-independent, regardless of the operating system or compiler suite. So, ``regular objects'' can be used to build shared libraries on these systems and no special PIC compiler flags are required.} @@ -4431,11 +4170,7 @@ Use @samp{-PIC} to generate PIC. On all known systems, a reloadable object can be created by running @kbd{ld -r -o @var{output}.o @var{input1}.o @var{input2}.o}. This reloadable object may be treated as exactly equivalent to other -objects. This is the piecewise method that libtool uses to get around -shell limitations when building large libraries. The object files -created by libtool are linked together in as few steps as necessary -into a single reloadable object file. This temporary object file -is then used to generate a shared library. +objects. @node Multiple dependencies @subsection Multiple dependencies @@ -4449,15 +4184,9 @@ Particularly, if a pair of static archives each resolve some of the other's symbols, it might be necessary to list one of those archives both before and after the other one. Libtool does not currently cope with this situation well, since dupicate libraries are removed from -thr link line. - -If you find yourself developing on a host that requires you to list -libraries multiple times in order for it to generate correctly linked -objects, you can defeat libtool's removal algorithm like this: - -@example -$ libtool ... -lfoo -lbar -Wl,-lfoo -@end example +the link line by default. Libtool provides the command line option +@samp{--preserve-dup-deps} to preserve all duplicate dependencies +in cases where it is necessary. @node Archivers @subsection Archivers @@ -4477,12 +4206,19 @@ use the @code{ar ts} command, instead. @cindex implementation of libtool @cindex libtool implementation -The @code{libtool} script is generated by @code{ltconfig} -(@pxref{Configuring}). From libtool version 0.7 to 1.0, this script +Since version 1.4, the @code{libtool} script is generated by +@code{configure} (@pxref{Configuring}). In earlier versions, +@code{configure} achieved this by calling a helper script called +@file{ltconfig}. From libtool version 0.7 to 1.0, this script simply set shell variables, then sourced the libtool backend, -@code{ltmain.sh}. @code{ltconfig} from libtool version 1.1 and later -inlines the contents of @code{ltmain.sh} into the generated -@code{libtool}, which improves performance on many systems. +@code{ltmain.sh}. @code{ltconfig} from libtool version 1.1 through 1.3 +inlined the contents of @code{ltmain.sh} into the generated +@code{libtool}, which improved performance on many systems. The tests +that @file{ltconfig} used to perform are now kept in @file{libtool.m4} +where thay can be written using Autoconf. This has the runtime +performance benefits of inlined @code{ltmain.sh}, @emph{and} improves +the build time a little while considerably easing the amount of raw +shell code that used to need maintaining. The convention used for naming variables which hold shell commands for delayed evaluation, is to use the suffix @code{_cmd} where a single @@ -4492,7 +4228,7 @@ evaluation. By convention, @code{_cmds} variables delimit the evaluation units with the @code{~} character where necessary. Here is a listing of each of the configuration variables, and how they -are used within @code{ltmain.sh}: +are used within @code{ltmain.sh} (@pxref{Configuring}): @defvar AR The name of the system library archiver. @@ -4507,12 +4243,6 @@ The name of the linker that libtool should use internally for reloadable linking and possibly shared libraries. @end defvar -@defvar LTCONFIG_VERSION -This is set to the version number of the @code{ltconfig} script, to -prevent mismatches between the configuration information in -@code{libtool}, and how that information is used in @code{ltmain.sh}. -@end defvar - @defvar NM The name of a BSD-compatible @code{nm} program, which produces listings of global symbols in one the following formats: @@ -4882,7 +4612,8 @@ libraries. @defvar version_type The library version numbering type. One of @samp{libtool}, -@samp{linux}, @samp{osf}, @samp{sunos}, or @samp{none}. +@samp{freebsd-aout}, @samp{freebsd-elf}, @samp{irix}, @samp{linux}, +@samp{osf}, @samp{sunos}, @samp{windows}, or @samp{none}. @end defvar @defvar whole_archive_flag_spec @@ -4895,7 +4626,7 @@ linker. Used as: @code{$@{wl@}@var{some-flag}}. @end defvar Variables ending in @samp{_cmds} or @samp{_eval} contain a -semicolon-separated list of commands that are @code{eval}ed one after +@samp{~}-separated list of commands that are @code{eval}ed one after another. If any of the commands return a nonzero exit status, libtool generally exits with an error message. @@ -4917,9 +4648,8 @@ than having to trust second-hand observation. @item Rather than reconfiguring libtool every time I make a change to -@code{ltconfig.in} or @code{ltmain.in}, I keep a permanent -@code{libtool} script in my @var{PATH}, which sources @code{ltmain.in} -directly. +@code{ltmain.in}, I keep a permanent @code{libtool} script in my +@var{PATH}, which sources @code{ltmain.in} directly. The following steps describe how to create such a script, where @code{/home/src/libtool} is the directory containing the libtool source @@ -4928,15 +4658,12 @@ configured for your platform, and @code{~/bin} is a directory in your @var{PATH}: @example -trick$ @kbd{cd ~/bin} -trick$ @kbd{sed '/^# ltmain\.sh/q' /home/src/libtool/libtool > libtool} -trick$ @kbd{cat >> libtool -LTCONFIG_VERSION="@@VERSION@@" -. /home/src/libtool/ltmain.in -^D} -trick$ @kbd{chmod +x libtool} -trick$ @kbd{libtool --version} -ltmain.sh (GNU @@PACKAGE@@) @@VERSION@@ +trick$ cd ~/bin +trick$ sed '/^# ltmain\.sh/q' /home/src/libtool/libtool > libtool +trick$ echo '. /home/src/libtool/ltmain.in' >> libtool +trick$ chmod +x libtool +trick$ libtool --version +ltmain.sh (GNU @@PACKAGE@@) @@VERSION@@@@TIMESTAMP@@ trick$ @end example @end itemize @@ -4944,7 +4671,7 @@ trick$ The output of the final @samp{libtool --version} command shows that the @code{ltmain.in} script is being used directly. Now, modify @code{~/bin/libtool} or @code{/home/src/libtool/ltmain.in} directly in -order to test new changes without having to rerun @code{ltconfig}. +order to test new changes without having to rerun @code{configure}. @include fdl.texi diff --git a/libltdl/Makefile.am b/libltdl/Makefile.am index fd9797b04..aa2a2728b 100644 --- a/libltdl/Makefile.am +++ b/libltdl/Makefile.am @@ -18,7 +18,7 @@ endif CLEANFILES = libltdl.la libltdlc.la libltdl_la_SOURCES = ltdl.c -libltdl_la_LDFLAGS = -no-undefined -version-info 3:0:0 +libltdl_la_LDFLAGS = -no-undefined -version-info 4:0:1 libltdl_la_LIBADD = $(LIBADD_DL) libltdlc_la_SOURCES = ltdl.c @@ -27,7 +27,7 @@ libltdlc_la_LIBADD = $(LIBADD_DL) ## Because we do not have automatic dependency tracking: ltdl.lo: ltdl.h config.h -$(OBJECTS): libtool +$(libltdl_la_OBJECTS) $(libltdlc_la_OBJECTS): libtool libtool: $(LIBTOOL_DEPS) $(SHELL) ./config.status --recheck diff --git a/libltdl/acconfig.h b/libltdl/acconfig.h deleted file mode 100644 index 15f115c74..000000000 --- a/libltdl/acconfig.h +++ /dev/null @@ -1,12 +0,0 @@ -/* Some of these are defined here, not in configure.in, because - they're AC_DEFINEd in two different places, which causes two - defines to appear. Some C compilers might now appreciate it... */ - -/* Define if you have the libdl library or equivalent. */ -#undef HAVE_LIBDL - -/* Define if you have the GNU dld library. */ -#undef HAVE_DLD - -/* Define if you have the shl_load function. */ -#undef HAVE_SHL_LOAD diff --git a/libltdl/configure.ac b/libltdl/configure.ac new file mode 100644 index 000000000..225883ee6 --- /dev/null +++ b/libltdl/configure.ac @@ -0,0 +1,84 @@ +## Process this file with autoconf to create configure. -*- autoconf -*- +# Copyright 2001 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA + + +## FIXME: Is this really new enough? ## +AC_PREREQ(2.50) + + +## ------------------------ ## +## Autoconf initialisation. ## +## ------------------------ ## +AC_INIT([libltdl], [1.2], [bug-libtool@gnu.org]) +AC_CONFIG_SRCDIR([ltdl.c]) + + +## ------------------------------- ## +## Libltdl specific configuration. ## +## ------------------------------- ## + +# We shouldn't be using these internal macros of autoconf, +# but CONFIG_AUX_DIR($with_auxdir) breaks automake. +AC_ARG_WITH([auxdir], + [AC_HELP_STRING([--with-auxdir=DIR], [path to autoconf auxiliary files])], + [AC_CONFIG_AUX_DIRS($with_auxdir)], + [AC_CONFIG_AUX_DIR_DEFAULT]) + +if test -z "$enable_ltdl_install$enable_ltdl_convenience"; then + if test -f ${srcdir}/ltmain.sh; then + # if libltdl is libtoolized, it is assumed to be stand-alone and + # installed unless the command line overrides it (tested above) + enable_ltdl_install=yes + else + AC_MSG_WARN([*** The top-level configure must select either]) + AC_MSG_WARN([*** [A""C_LIBLTDL_INSTALLABLE] or [A""C_LIBLTDL_CONVENIENCE].]) + AC_MSG_ERROR([*** Maybe you want to --enable-ltdl-install?]) + fi +fi + + +## ------------------------ ## +## Automake Initialisation. ## +## ------------------------ ## +AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION, -) +AM_CONFIG_HEADER([config.h:config-h.in]) + + +## ------------------ ## +## C compiler checks. ## +## ------------------ ## +AC_PROG_CC +AC_C_CONST +AC_C_INLINE + + +## ----------------------- ## +## Libtool initialisation. ## +## ----------------------- ## +AC_LIBTOOL_WIN32_DLL +AC_PROG_LIBTOOL +AC_SUBST([LIBTOOL_DEPS]) + +AC_LIB_LTDL + + +## -------- ## +## Outputs. ## +## -------- ## +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 872a5701d..b277fe911 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -29,6 +29,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA # include #endif +#if HAVE_UNISTD_H +# include +#endif + #if HAVE_STDIO_H # include #endif @@ -57,8 +61,43 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA # include #endif +#if HAVE_ERRNO_H +# include +#endif + +#if HAVE_DIRENT_H +# include +# define LT_D_NAMLEN(dirent) (strlen((dirent)->d_name)) +#else +# define dirent direct +# define LT_D_NAMLEN(dirent) ((dirent)->d_namlen) +# if HAVE_SYS_NDIR_H +# include +# endif +# if HAVE_SYS_DIR_H +# include +# endif +# if HAVE_NDIR_H +# include +# endif +#endif + +#if HAVE_ARGZ_H +# include +#endif + +#if HAVE_ASSERT_H +# include +#else +# define assert(arg) ((void) 0) +#endif + #include "ltdl.h" +#if WITH_DMALLOC +# include +#endif + @@ -85,6 +124,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA /* --- MANIFEST CONSTANTS --- */ +/* Standard libltdl search path environment variable name */ +#undef LTDL_SEARCHPATH_VAR +#define LTDL_SEARCHPATH_VAR "LTDL_LIBRARY_PATH" + +/* Standard libtool archive file extension. */ +#undef LTDL_ARCHIVE_EXT +#define LTDL_ARCHIVE_EXT ".la" + /* max. filename length */ #ifndef LT_FILENAME_MAX # define LT_FILENAME_MAX 1024 @@ -101,239 +148,53 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -/* --- TYPE DEFINITIONS -- */ - - -/* This type is used for the array of caller data sets in each handler. */ -typedef struct { - lt_dlcaller_id key; - lt_ptr data; -} lt_caller_data; - - - - -/* --- OPAQUE STRUCTURES DECLARED IN LTDL.H --- */ - - -/* Extract the diagnostic strings from the error table macro in the same - order as the enumberated indices in ltdl.h. */ - -static const char *lt_dlerror_strings[] = - { -#define LT_ERROR(name, diagnostic) (diagnostic), - lt_dlerror_table -#undef LT_ERROR - - 0 - }; - -/* This structure is used for the list of registered loaders. */ -struct lt_dlloader { - struct lt_dlloader *next; - const char *loader_name; /* identifying name for each loader */ - const char *sym_prefix; /* prefix for symbols */ - lt_module_open *module_open; - lt_module_close *module_close; - lt_find_sym *find_sym; - lt_dlloader_exit *dlloader_exit; - lt_user_data dlloader_data; -}; - -struct lt_dlhandle_struct { - struct lt_dlhandle_struct *next; - lt_dlloader *loader; /* dlopening interface */ - lt_dlinfo info; - int depcount; /* number of dependencies */ - lt_dlhandle *deplibs; /* dependencies */ - lt_module module; /* system module handle */ - lt_ptr system; /* system specific data */ - lt_caller_data *caller_data; /* per caller associated data */ - int flags; /* various boolean stats */ -}; - -/* Various boolean flags can be stored in the flags field of an - lt_dlhandle_struct... */ -#define LT_DLGET_FLAG(handle, flag) (((handle)->flags & (flag)) == (flag)) -#define LT_DLSET_FLAG(handle, flag) ((handle)->flags |= (flag)) - -#define LT_DLRESIDENT_FLAG (0x01 << 0) -/* ...add more flags here... */ - -#define LT_DLIS_RESIDENT(handle) LT_DLGET_FLAG(handle, LT_DLRESIDENT_FLAG) - - -#define LT_DLSTRERROR(name) lt_dlerror_strings[LT_CONC(LT_ERROR_,name)] - -static const char objdir[] = LTDL_OBJDIR; -#ifdef LTDL_SHLIB_EXT -static const char shlib_ext[] = LTDL_SHLIB_EXT; -#endif -#ifdef LTDL_SYSSEARCHPATH -static const char sys_search_path[] = LTDL_SYSSEARCHPATH; -#endif - - - - -/* --- MUTEX LOCKING --- */ - - -/* Macros to make it easier to run the lock functions only if they have - been registered. The reason for the complicated lock macro is to - ensure that the stored error message from the last error is not - accidentally erased if the current function doesn't generate an - error of its own. */ -#define MUTEX_LOCK() LT_STMT_START { \ - if (mutex_lock) (*mutex_lock)(); } LT_STMT_END -#define MUTEX_UNLOCK() LT_STMT_START { \ - if (mutex_unlock) (*mutex_unlock)(); } LT_STMT_END -#define MUTEX_SETERROR(errormsg) LT_STMT_START { \ - if (mutex_seterror) (*mutex_seterror) (errormsg); \ - else last_error = (errormsg); } LT_STMT_END -#define MUTEX_GETERROR(errormsg) LT_STMT_START { \ - if (mutex_seterror) errormsg = (*mutex_geterror)(); \ - else (errormsg) = last_error; } LT_STMT_END - -/* The mutex functions stored here are global, and are necessarily the - same for all threads that wish to share access to libltdl. */ -static lt_dlmutex_lock *mutex_lock = 0; -static lt_dlmutex_unlock *mutex_unlock = 0; -static lt_dlmutex_seterror *mutex_seterror = 0; -static lt_dlmutex_geterror *mutex_geterror = 0; -static const char *last_error = 0; - - -/* Either set or reset the mutex functions. Either all the arguments must - be valid functions, or else all can be NULL to turn off locking entirely. - The registered functions should be manipulating a static global lock - from the lock() and unlock() callbacks, which needs to be reentrant. */ -int -lt_dlmutex_register (lock, unlock, seterror, geterror) - lt_dlmutex_lock *lock; - lt_dlmutex_unlock *unlock; - lt_dlmutex_seterror *seterror; - lt_dlmutex_geterror *geterror; -{ - lt_dlmutex_unlock *old_unlock = unlock; - int errors = 0; - - /* Lock using the old lock() callback, if any. */ - MUTEX_LOCK (); - - if ((lock && unlock && seterror && geterror) - || !(lock || unlock || seterror || geterror)) - { - mutex_lock = lock; - mutex_unlock = unlock; - mutex_geterror = geterror; - } - else - { - MUTEX_SETERROR (LT_DLSTRERROR (INVALID_MUTEX_ARGS)); - ++errors; - } +/* --- MEMORY HANDLING --- */ - /* Use the old unlock() callback we saved earlier, if any. Otherwise - record any errors using internal storage. */ - if (old_unlock) - (*old_unlock) (); - /* Return the number of errors encountered during the execution of - this function. */ - return errors; -} +/* These are the functions used internally. In addition to making + use of the associated function pointers above, they also perform + error handling. */ +static char *lt_estrdup LT_PARAMS((const char *str)); +static lt_ptr lt_emalloc LT_PARAMS((size_t size)); +static lt_ptr lt_erealloc LT_PARAMS((lt_ptr addr, size_t size)); +static lt_ptr rpl_realloc LT_PARAMS((lt_ptr ptr, size_t size)); +/* These are the pointers that can be changed by the caller: */ +LT_GLOBAL_DATA lt_ptr (*lt_dlmalloc) LT_PARAMS((size_t size)) + = (lt_ptr (*) LT_PARAMS((size_t))) malloc; +LT_GLOBAL_DATA lt_ptr (*lt_dlrealloc) LT_PARAMS((lt_ptr ptr, size_t size)) + = (lt_ptr (*) LT_PARAMS((lt_ptr, size_t))) rpl_realloc; +LT_GLOBAL_DATA void (*lt_dlfree) LT_PARAMS((lt_ptr ptr)) + = (void (*) LT_PARAMS((lt_ptr))) free; - -/* --- MEMORY HANDLING --- */ +/* The following macros reduce the amount of typing needed to cast + assigned memory. */ +#if WITH_DMALLOC +#define LT_DLMALLOC(tp, n) ((tp *) xmalloc ((n) * sizeof(tp))) +#define LT_DLREALLOC(tp, p, n) ((tp *) xrealloc ((p), (n) * sizeof(tp))) +#define LT_DLFREE(p) \ + LT_STMT_START { if (p) (p) = (xfree (p), (lt_ptr) 0); } LT_STMT_END -LT_GLOBAL_DATA lt_ptr (*lt_dlmalloc) LT_PARAMS((size_t size)) - = (lt_ptr (*) LT_PARAMS((size_t))) malloc; -LT_GLOBAL_DATA void (*lt_dlfree) LT_PARAMS((lt_ptr ptr)) - = (void (*) LT_PARAMS((lt_ptr))) free; +#define LT_EMALLOC(tp, n) ((tp *) xmalloc ((n) * sizeof(tp))) +#define LT_EREALLOC(tp, p, n) ((tp *) xrealloc ((p), (n) * sizeof(tp))) -static lt_ptr rpl_realloc LT_PARAMS((lt_ptr ptr, - size_t size)); +#else #define LT_DLMALLOC(tp, n) ((tp *) lt_dlmalloc ((n) * sizeof(tp))) #define LT_DLREALLOC(tp, p, n) ((tp *) rpl_realloc ((p), (n) * sizeof(tp))) #define LT_DLFREE(p) \ LT_STMT_START { if (p) (p) = (lt_dlfree (p), (lt_ptr) 0); } LT_STMT_END -#define LT_DLMEM_REASSIGN(p, q) LT_STMT_START { \ - if ((p) != (q)) { lt_dlfree (p); (p) = (q); } \ - } LT_STMT_END - - - -/* --- ERROR MESSAGES --- */ - - -static const char **user_error_strings = 0; -static int errorcount = LT_ERROR_MAX; - -int -lt_dladderror (diagnostic) - const char *diagnostic; -{ - int index = 0; - int result = -1; - const char **temp = (const char **) 0; - - MUTEX_LOCK (); - - index = errorcount - LT_ERROR_MAX; - temp = LT_DLREALLOC (const char *, user_error_strings, 1 + index); - if (temp == 0) - { - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); - } - else - { - user_error_strings = temp; - user_error_strings[index] = diagnostic; - result = errorcount++; - } - - MUTEX_UNLOCK (); - - return result; -} - -int -lt_dlseterror (index) - int index; -{ - int errors = 0; - - MUTEX_LOCK (); - - if (index >= errorcount || index < 0) - { - /* Ack! Error setting the error message! */ - MUTEX_SETERROR (LT_DLSTRERROR (INVALID_ERRORCODE)); - ++errors; - } - else if (index < LT_ERROR_MAX) - { - /* No error setting the error message! */ - MUTEX_SETERROR (lt_dlerror_strings[errorcount]); - } - else - { - /* No error setting the error message! */ - MUTEX_SETERROR (user_error_strings[errorcount - LT_ERROR_MAX]); - } - - MUTEX_UNLOCK (); - - return errors; -} +#define LT_EMALLOC(tp, n) ((tp *) lt_emalloc ((n) * sizeof(tp))) +#define LT_EREALLOC(tp, p, n) ((tp *) lt_erealloc ((p), (n) * sizeof(tp))) +#endif +#define LT_DLMEM_REASSIGN(p, q) LT_STMT_START { \ + if ((p) != (q)) { if (p) lt_dlfree (p); (p) = (q); (q) = 0; } \ + } LT_STMT_END /* --- REPLACEMENT FUNCTIONS --- */ @@ -342,6 +203,8 @@ lt_dlseterror (index) #undef strdup #define strdup rpl_strdup +static char *strdup LT_PARAMS((const char *str)); + static char * strdup(str) const char *str; @@ -366,6 +229,8 @@ strdup(str) #undef strcmp #define strcmp rpl_strcmp +static int strcmp LT_PARAMS((const char *str1, const char *str2)); + static int strcmp (str1, str2) const char *str1; @@ -396,6 +261,8 @@ strcmp (str1, str2) # else # define strchr rpl_strchr +static const char *strchr LT_PARAMS((const char *str, int ch)); + static const char* strchr(str, ch) const char *str; @@ -403,7 +270,7 @@ strchr(str, ch) { const char *p; - for (p = str; *p != (char)ch && *p != '\0'; ++p) + for (p = str; *p != (char)ch && *p != LT_EOS_CHAR; ++p) /*NOWORK*/; return (*p == (char)ch) ? p : 0; @@ -412,6 +279,7 @@ strchr(str, ch) # endif #endif /* !HAVE_STRCHR */ + #if ! HAVE_STRRCHR # if HAVE_RINDEX @@ -419,6 +287,8 @@ strchr(str, ch) # else # define strrchr rpl_strrchr +static const char *strrchr LT_PARAMS((const char *str, int ch)); + static const char* strrchr(str, ch) const char *str; @@ -426,7 +296,7 @@ strrchr(str, ch) { const char *p, *q = 0; - for (p = str; *p != '\0'; ++p) + for (p = str; *p != LT_EOS_CHAR; ++p) { if (*p == (char) ch) { @@ -441,8 +311,9 @@ strrchr(str, ch) #endif /* NOTE: Neither bcopy nor the memcpy implementation below can - reliably handle copying in overlapping areas of memory, so - do not rely on this behaviour when invoking memcpy later. */ + reliably handle copying in overlapping areas of memory. Use + memmove (for which there is a fallback implmentation below) + if you need that behaviour. */ #if ! HAVE_MEMCPY # if HAVE_BCOPY @@ -450,10 +321,12 @@ strrchr(str, ch) # else # define memcpy rpl_memcpy -static char * +static lt_ptr memcpy LT_PARAMS((lt_ptr dest, const lt_ptr src, size_t size)); + +static lt_ptr memcpy (dest, src, size) - char *dest; - const char *src; + lt_ptr dest; + const lt_ptr src; size_t size; { size_t i = 0; @@ -466,8 +339,38 @@ memcpy (dest, src, size) return dest; } -# endif -#endif +# endif /* !HAVE_BCOPY */ +#endif /* !HAVE_MEMCPY */ + +#if ! HAVE_MEMMOVE +# define memmove rpl_memmove + +static lt_ptr memmove LT_PARAMS((lt_ptr dest, const lt_ptr src, size_t size)); + +static lt_ptr +memmove (dest, src, size) + lt_ptr dest; + const lt_ptr src; + size_t size; +{ + size_t i; + + if (dest < src) + for (i = 0; i < size; ++i) + { + dest[i] = src[i]; + } + else if (dest > src) + for (i = size -1; i >= 0; --i) + { + dest[i] = src[i]; + } + + return dest; +} + +#endif /* !HAVE_MEMMOVE */ + /* According to Alexandre Oliva , ``realloc is not entirely portable'' @@ -475,12 +378,16 @@ memcpy (dest, src, size) burdening them with an lt_dlrealloc function pointer to maintain. Instead implement our own version (with known boundary conditions) using lt_dlmalloc and lt_dlfree. */ + +#undef realloc +#define realloc rpl_realloc + static lt_ptr -rpl_realloc (ptr, size) +realloc (ptr, size) lt_ptr ptr; size_t size; { - if (size < 1) + if (size == 0) { /* For zero or less bytes, free the original memory */ if (ptr != 0) @@ -513,6 +420,492 @@ rpl_realloc (ptr, size) } +#if ! HAVE_ARGZ_APPEND +# define argz_append rpl_argz_append + +static error_t argz_append LT_PARAMS((char **pargz, size_t *pargz_len, + const char *buf, size_t buf_len)); + +static error_t +argz_append (pargz, pargz_len, buf, buf_len) + char **pargz; + size_t *pargz_len; + const char *buf; + size_t buf_len; +{ + size_t argz_len; + char *argz; + + assert (pargz); + assert (pargz_len); + assert ((*pargz && *pargz_len) || (!*pargz && !*pargz_len)); + + /* If nothing needs to be appended, no more work is required. */ + if (buf_len == 0) + return 0; + + /* Ensure there is enough room to append BUF_LEN. */ + argz_len = *pargz_len + buf_len; + argz = LT_DLREALLOC (char, *pargz, argz_len); + if (!argz) + return ENOMEM; + + /* Copy characters from BUF after terminating '\0' in ARGZ. */ + memcpy (argz + *pargz_len, buf, buf_len); + + /* Assign new values. */ + *pargz = argz; + *pargz_len = argz_len; + + return 0; +} +#endif /* !HAVE_ARGZ_APPEND */ + + +#if ! HAVE_ARGZ_CREATE_SEP +# define argz_create_sep rpl_argz_create_sep + +static error_t argz_create_sep LT_PARAMS((const char *str, int delim, + char **pargz, size_t *pargz_len)); + +static error_t +argz_create_sep (str, delim, pargz, pargz_len) + const char *str; + int delim; + char **pargz; + size_t *pargz_len; +{ + size_t argz_len; + char *argz = 0; + + assert (str); + assert (pargz); + assert (pargz_len); + + /* Make a copy of STR, but replacing each occurence of + DELIM with '\0'. */ + argz_len = 1+ LT_STRLEN (str); + if (argz_len) + { + const char *p; + char *q; + + argz = LT_DLMALLOC (char, argz_len); + if (!argz) + return ENOMEM; + + for (p = str, q = argz; *p != LT_EOS_CHAR; ++p) + { + if (*p == delim) + { + /* Ignore leading delimiters, and fold consecutive + delimiters in STR into a single '\0' in ARGZ. */ + if ((q > argz) && (q[-1] != LT_EOS_CHAR)) + *q++ = LT_EOS_CHAR; + else + --argz_len; + } + else + *q++ = *p; + } + /* Copy terminating LT_EOS_CHAR. */ + *q = *p; + } + + /* If ARGZ_LEN has shrunk to nothing, release ARGZ's memory. */ + if (!argz_len) + LT_DLFREE (argz); + + /* Assign new values. */ + *pargz = argz; + *pargz_len = argz_len; + + return 0; +} +#endif /* !HAVE_ARGZ_CREATE_SEP */ + + +#if ! HAVE_ARGZ_INSERT +# define argz_insert rpl_argz_insert + +static error_t argz_insert LT_PARAMS((char **pargz, size_t *pargz_len, + char *before, const char *entry)); + +static error_t +argz_insert (pargz, pargz_len, before, entry) + char **pargz; + size_t *pargz_len; + char *before; + const char *entry; +{ + assert (pargz); + assert (pargz_len); + assert (entry && *entry); + + /* Either PARGZ/PARGZ_LEN is empty and BEFORE is NULL, + or BEFORE points into an address within the ARGZ vector. */ + assert ((!*pargz && !*pargz_len && !before) + || ((*pargz <= before) && (before < (*pargz + *pargz_len)))); + + /* No BEFORE address indicates ENTRY should be inserted after the + current last element. */ + if (!before) + return argz_append (pargz, pargz_len, entry, 1+ LT_STRLEN (entry)); + + /* This probably indicates a programmer error, but to preserve + semantics, scan back to the start of an entry if BEFORE points + into the middle of it. */ + while ((before >= *pargz) && (before[-1] != LT_EOS_CHAR)) + --before; + + { + size_t entry_len = 1+ LT_STRLEN (entry); + size_t argz_len = *pargz_len + entry_len; + size_t offset = before - *pargz; + char *argz = LT_DLREALLOC (char, *pargz, argz_len); + + if (!argz) + return ENOMEM; + + /* Make BEFORE point to the equivalent offset in ARGZ that it + used to have in *PARGZ incase realloc() moved the block. */ + before = argz + offset; + + /* Move the ARGZ entries starting at BEFORE up into the new + space at the end -- making room to copy ENTRY into the + resulting gap. */ + memmove (before + entry_len, before, *pargz_len - offset); + memcpy (before, entry, entry_len); + + /* Assign new values. */ + *pargz = argz; + *pargz_len = argz_len; + } + + return 0; +} +#endif /* !HAVE_ARGZ_INSERT */ + + +#if ! HAVE_ARGZ_NEXT +# define argz_next rpl_argz_next + +static char *argz_next LT_PARAMS((char *argz, size_t argz_len, + const char *entry)); + +static char * +argz_next (argz, argz_len, entry) + char *argz; + size_t argz_len; + const char *entry; +{ + assert ((argz && argz_len) || (!argz && !argz_len)); + + if (entry) + { + /* Either ARGZ/ARGZ_LEN is empty, or ENTRY points into an address + within the ARGZ vector. */ + assert ((!argz && !argz_len) + || ((argz <= entry) && (entry < (argz + argz_len)))); + + /* Move to the char immediately after the terminating + '\0' of ENTRY. */ + entry = 1+ strchr (entry, LT_EOS_CHAR); + + /* Return either the new ENTRY, or else NULL if ARGZ is + exhausted. */ + return (entry >= argz + argz_len) ? 0 : (char *) entry; + } + else + { + /* This should probably be flagged as a programmer error, + since starting an argz_next loop with the iterator set + to ARGZ is safer. To preserve semantics, handle the NULL + case by returning the start of ARGZ (if any). */ + if (argz_len > 0) + return argz; + else + return 0; + } +} +#endif /* !HAVE_ARGZ_NEXT */ + + + +#if ! HAVE_ARGZ_STRINGIFY +# define argz_stringify rpl_argz_stringify + +static void argz_stringify LT_PARAMS((char *argz, size_t argz_len, + int sep)); + +static void +argz_stringify (argz, argz_len, sep) + char *argz; + size_t argz_len; + int sep; +{ + assert ((argz && argz_len) || (!argz && !argz_len)); + + if (sep) + { + --argz_len; /* don't stringify the terminating EOS */ + while (--argz_len > 0) + { + if (argz[argz_len] == LT_EOS_CHAR) + argz[argz_len] = sep; + } + } +} +#endif /* !HAVE_ARGZ_STRINGIFY */ + + + + +/* --- TYPE DEFINITIONS -- */ + + +/* This type is used for the array of caller data sets in each handler. */ +typedef struct { + lt_dlcaller_id key; + lt_ptr data; +} lt_caller_data; + + + + +/* --- OPAQUE STRUCTURES DECLARED IN LTDL.H --- */ + + +/* Extract the diagnostic strings from the error table macro in the same + order as the enumerated indices in ltdl.h. */ + +static const char *lt_dlerror_strings[] = + { +#define LT_ERROR(name, diagnostic) (diagnostic), + lt_dlerror_table +#undef LT_ERROR + + 0 + }; + +/* This structure is used for the list of registered loaders. */ +struct lt_dlloader { + struct lt_dlloader *next; + const char *loader_name; /* identifying name for each loader */ + const char *sym_prefix; /* prefix for symbols */ + lt_module_open *module_open; + lt_module_close *module_close; + lt_find_sym *find_sym; + lt_dlloader_exit *dlloader_exit; + lt_user_data dlloader_data; +}; + +struct lt_dlhandle_struct { + struct lt_dlhandle_struct *next; + lt_dlloader *loader; /* dlopening interface */ + lt_dlinfo info; + int depcount; /* number of dependencies */ + lt_dlhandle *deplibs; /* dependencies */ + lt_module module; /* system module handle */ + lt_ptr system; /* system specific data */ + lt_caller_data *caller_data; /* per caller associated data */ + int flags; /* various boolean stats */ +}; + +/* Various boolean flags can be stored in the flags field of an + lt_dlhandle_struct... */ +#define LT_DLGET_FLAG(handle, flag) (((handle)->flags & (flag)) == (flag)) +#define LT_DLSET_FLAG(handle, flag) ((handle)->flags |= (flag)) + +#define LT_DLRESIDENT_FLAG (0x01 << 0) +/* ...add more flags here... */ + +#define LT_DLIS_RESIDENT(handle) LT_DLGET_FLAG(handle, LT_DLRESIDENT_FLAG) + + +#define LT_DLSTRERROR(name) lt_dlerror_strings[LT_CONC(LT_ERROR_,name)] + +static const char objdir[] = LTDL_OBJDIR; +static const char archive_ext[] = LTDL_ARCHIVE_EXT; +#ifdef LTDL_SHLIB_EXT +static const char shlib_ext[] = LTDL_SHLIB_EXT; +#endif +#ifdef LTDL_SYSSEARCHPATH +static const char sys_search_path[] = LTDL_SYSSEARCHPATH; +#endif + + + + +/* --- MUTEX LOCKING --- */ + + +/* Macros to make it easier to run the lock functions only if they have + been registered. The reason for the complicated lock macro is to + ensure that the stored error message from the last error is not + accidentally erased if the current function doesn't generate an + error of its own. */ +#define LT_DLMUTEX_LOCK() LT_STMT_START { \ + if (lt_dlmutex_lock_func) (*lt_dlmutex_lock_func)(); \ + } LT_STMT_END +#define LT_DLMUTEX_UNLOCK() LT_STMT_START { \ + if (lt_dlmutex_unlock_func) (*lt_dlmutex_unlock_func)();\ + } LT_STMT_END +#define LT_DLMUTEX_SETERROR(errormsg) LT_STMT_START { \ + if (lt_dlmutex_seterror_func) \ + (*lt_dlmutex_seterror_func) (errormsg); \ + else lt_dllast_error = (errormsg); } LT_STMT_END +#define LT_DLMUTEX_GETERROR(errormsg) LT_STMT_START { \ + if (lt_dlmutex_seterror_func) \ + (errormsg) = (*lt_dlmutex_geterror_func) (); \ + else (errormsg) = lt_dllast_error; } LT_STMT_END + +/* The mutex functions stored here are global, and are necessarily the + same for all threads that wish to share access to libltdl. */ +static lt_dlmutex_lock *lt_dlmutex_lock_func = 0; +static lt_dlmutex_unlock *lt_dlmutex_unlock_func = 0; +static lt_dlmutex_seterror *lt_dlmutex_seterror_func = 0; +static lt_dlmutex_geterror *lt_dlmutex_geterror_func = 0; +static const char *lt_dllast_error = 0; + + +/* Either set or reset the mutex functions. Either all the arguments must + be valid functions, or else all can be NULL to turn off locking entirely. + The registered functions should be manipulating a static global lock + from the lock() and unlock() callbacks, which needs to be reentrant. */ +int +lt_dlmutex_register (lock, unlock, seterror, geterror) + lt_dlmutex_lock *lock; + lt_dlmutex_unlock *unlock; + lt_dlmutex_seterror *seterror; + lt_dlmutex_geterror *geterror; +{ + lt_dlmutex_unlock *old_unlock = unlock; + int errors = 0; + + /* Lock using the old lock() callback, if any. */ + LT_DLMUTEX_LOCK (); + + if ((lock && unlock && seterror && geterror) + || !(lock || unlock || seterror || geterror)) + { + lt_dlmutex_lock_func = lock; + lt_dlmutex_unlock_func = unlock; + lt_dlmutex_geterror_func = geterror; + } + else + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_MUTEX_ARGS)); + ++errors; + } + + /* Use the old unlock() callback we saved earlier, if any. Otherwise + record any errors using internal storage. */ + if (old_unlock) + (*old_unlock) (); + + /* Return the number of errors encountered during the execution of + this function. */ + return errors; +} + + + + +/* --- ERROR HANDLING --- */ + + +static const char **user_error_strings = 0; +static int errorcount = LT_ERROR_MAX; + +int +lt_dladderror (diagnostic) + const char *diagnostic; +{ + int errindex = 0; + int result = -1; + const char **temp = (const char **) 0; + + assert (diagnostic); + + LT_DLMUTEX_LOCK (); + + errindex = errorcount - LT_ERROR_MAX; + temp = LT_EREALLOC (const char *, user_error_strings, 1 + errindex); + if (temp) + { + user_error_strings = temp; + user_error_strings[errindex] = diagnostic; + result = errorcount++; + } + + LT_DLMUTEX_UNLOCK (); + + return result; +} + +int +lt_dlseterror (errindex) + int errindex; +{ + int errors = 0; + + LT_DLMUTEX_LOCK (); + + if (errindex >= errorcount || errindex < 0) + { + /* Ack! Error setting the error message! */ + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_ERRORCODE)); + ++errors; + } + else if (errindex < LT_ERROR_MAX) + { + /* No error setting the error message! */ + LT_DLMUTEX_SETERROR (lt_dlerror_strings[errindex]); + } + else + { + /* No error setting the error message! */ + LT_DLMUTEX_SETERROR (user_error_strings[errindex - LT_ERROR_MAX]); + } + + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +static lt_ptr +lt_emalloc (size) + size_t size; +{ + lt_ptr mem = lt_dlmalloc (size); + if (size && !mem) + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + return mem; +} + +static lt_ptr +lt_erealloc (addr, size) + lt_ptr addr; + size_t size; +{ + lt_ptr mem = realloc (addr, size); + if (size && !mem) + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + return mem; +} + +static char * +lt_estrdup (str) + const char *str; +{ + char *copy = strdup (str); + if (LT_STRLEN (str) && !copy) + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + return copy; +} + + /* --- DLOPEN() INTERFACE LOADER --- */ @@ -584,7 +977,7 @@ sys_dl_open (loader_data, filename) if (!module) { - MUTEX_SETERROR (DLERROR (CANNOT_OPEN)); + LT_DLMUTEX_SETERROR (DLERROR (CANNOT_OPEN)); } return module; @@ -599,7 +992,7 @@ sys_dl_close (loader_data, module) if (dlclose (module) != 0) { - MUTEX_SETERROR (DLERROR (CANNOT_CLOSE)); + LT_DLMUTEX_SETERROR (DLERROR (CANNOT_CLOSE)); ++errors; } @@ -616,7 +1009,7 @@ sys_dl_sym (loader_data, module, symbol) if (!address) { - MUTEX_SETERROR (DLERROR (SYMBOL_NOT_FOUND)); + LT_DLMUTEX_SETERROR (DLERROR (SYMBOL_NOT_FOUND)); } return address; @@ -693,9 +1086,9 @@ sys_shl_open (loader_data, filename) { static shl_t self = (shl_t) 0; lt_module module = shl_load (filename, LT_BIND_FLAGS, 0L); - + /* Since searching for a symbol against a NULL module handle will also - look in everything else that was already loaded and exported with + look in everything else that was already loaded and exported with the -E compiler flag, we always cache a handle saved before any modules are loaded. */ if (!self) @@ -703,7 +1096,7 @@ sys_shl_open (loader_data, filename) lt_ptr address; shl_findsym (&self, "main", TYPE_UNDEFINED, &address); } - + if (!filename) { module = self; @@ -714,10 +1107,10 @@ sys_shl_open (loader_data, filename) if (!module) { - MUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); } } - + return module; } @@ -730,7 +1123,7 @@ sys_shl_close (loader_data, module) if (module && (shl_unload ((shl_t) (module)) != 0)) { - MUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); ++errors; } @@ -748,16 +1141,16 @@ sys_shl_sym (loader_data, module, symbol) /* sys_shl_open should never return a NULL module handle */ if (module == (lt_module) 0) { - MUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); } else if (!shl_findsym((shl_t*) &module, symbol, TYPE_UNDEFINED, &address)) { if (!address) { - MUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); } } - + return address; } @@ -808,21 +1201,18 @@ sys_wll_open (loader_data, filename) if (ext) { /* FILENAME already has an extension. */ - searchname = strdup (filename); + searchname = lt_estrdup (filename); } else { /* Append a `.' to stop Windows from adding an implicit `.dll' extension. */ - searchname = LT_DLMALLOC (char, 2+ strlen (filename)); - if (!searchname) - { - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); - return 0; - } - strcpy (searchname, filename); - strcat (searchname, "."); + searchname = LT_EMALLOC (char, 2+ LT_STRLEN (filename)); + if (searchname) + sprintf (searchname, "%s.", filename); } + if (!searchname) + return 0; #if __CYGWIN__ { @@ -843,7 +1233,7 @@ sys_wll_open (loader_data, filename) We check whether LoadLibrary is returning a handle to an already loaded module, and simulate failure if we find one. */ - MUTEX_LOCK (); + LT_DLMUTEX_LOCK (); cur = handles; while (cur) { @@ -860,11 +1250,11 @@ sys_wll_open (loader_data, filename) cur = cur->next; } - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); if (cur || !module) { - MUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); module = 0; } @@ -880,7 +1270,7 @@ sys_wll_close (loader_data, module) if (FreeLibrary(module) == 0) { - MUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); ++errors; } @@ -897,7 +1287,7 @@ sys_wll_sym (loader_data, module, symbol) if (!address) { - MUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); } return address; @@ -942,7 +1332,7 @@ sys_bedl_open (loader_data, filename) if (image <= 0) { - MUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); image = 0; } @@ -958,7 +1348,7 @@ sys_bedl_close (loader_data, module) if (unload_add_on ((image_id) module) != B_OK) { - MUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); ++errors; } @@ -976,7 +1366,7 @@ sys_bedl_sym (loader_data, module, symbol) if (get_image_symbol (image, symbol, B_SYMBOL_TYPE_ANY, address) != B_OK) { - MUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); address = 0; } @@ -1010,14 +1400,9 @@ sys_dld_open (loader_data, filename) { lt_module module = strdup (filename); - if (!module) - { - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); - module = 0; - } - else if (dld_link (filename) != 0) + if (dld_link (filename) != 0) { - MUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); LT_DLFREE (module); module = 0; } @@ -1034,7 +1419,7 @@ sys_dld_close (loader_data, module) if (dld_unlink_by_file ((char*)(module), 1) != 0) { - MUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); ++errors; } else @@ -1055,7 +1440,7 @@ sys_dld_sym (loader_data, module, symbol) if (!address) { - MUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); } return address; @@ -1090,7 +1475,7 @@ presym_init (loader_data) { int errors = 0; - MUTEX_LOCK (); + LT_DLMUTEX_LOCK (); preloaded_symbols = 0; if (default_preloaded_symbols) @@ -1098,7 +1483,7 @@ presym_init (loader_data) errors = lt_dlpreload (default_preloaded_symbols); } - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); return errors; } @@ -1108,7 +1493,7 @@ presym_free_symlists () { lt_dlsymlists_t *lists; - MUTEX_LOCK (); + LT_DLMUTEX_LOCK (); lists = preloaded_symbols; while (lists) @@ -1120,7 +1505,7 @@ presym_free_symlists () } preloaded_symbols = 0; - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); return 0; } @@ -1141,7 +1526,7 @@ presym_add_symlist (preloaded) lt_dlsymlists_t *lists; int errors = 0; - MUTEX_LOCK (); + LT_DLMUTEX_LOCK (); lists = preloaded_symbols; while (lists) @@ -1153,21 +1538,21 @@ presym_add_symlist (preloaded) lists = lists->next; } - tmp = LT_DLMALLOC (lt_dlsymlists_t, 1); + tmp = LT_EMALLOC (lt_dlsymlists_t, 1); if (tmp) { + memset (tmp, 0, sizeof(lt_dlsymlists_t)); tmp->syms = preloaded; tmp->next = preloaded_symbols; preloaded_symbols = tmp; } else { - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); ++errors; } done: - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); return errors; } @@ -1179,15 +1564,19 @@ presym_open (loader_data, filename) lt_dlsymlists_t *lists; lt_module module = (lt_module) 0; - MUTEX_LOCK (); + LT_DLMUTEX_LOCK (); lists = preloaded_symbols; if (!lists) { - MUTEX_SETERROR (LT_DLSTRERROR (NO_SYMBOLS)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_SYMBOLS)); goto done; } + /* Can't use NULL as the reflective symbol header, as NULL is + used to mark the end of the entire symbol list. Self-dlpreopened + symbols follow this magic number, chosen to be an unlikely + clash with a real module name. */ if (!filename) { filename = "@PROGRAM@"; @@ -1210,10 +1599,10 @@ presym_open (loader_data, filename) lists = lists->next; } - MUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); done: - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); return module; } @@ -1246,7 +1635,7 @@ presym_sym (loader_data, module, symbol) ++syms; } - MUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); return 0; } @@ -1262,6 +1651,70 @@ static struct lt_user_dlloader presym = { /* --- DYNAMIC MODULE LOADING --- */ +/* The type of a function used at each iteration of foreach_dirinpath(). */ +typedef int foreach_callback_func LT_PARAMS((char *filename, lt_ptr data1, + lt_ptr data2)); + +static int foreach_dirinpath LT_PARAMS((const char *search_path, + const char *base_name, + foreach_callback_func *func, + lt_ptr data1, lt_ptr data2)); + +static int find_file_callback LT_PARAMS((char *filename, lt_ptr data, + lt_ptr ignored)); +static int find_handle_callback LT_PARAMS((char *filename, lt_ptr data, + lt_ptr ignored)); +static int foreachfile_callback LT_PARAMS((char *filename, lt_ptr data1, + lt_ptr data2)); + + +static int canonicalize_path LT_PARAMS((const char *path, + char **pcanonical)); +static int argzize_path LT_PARAMS((const char *path, + char **pargz, + size_t *pargz_len)); +static FILE *find_file LT_PARAMS((const char *search_path, + const char *base_name, + char **pdir)); +static lt_dlhandle *find_handle LT_PARAMS((const char *search_path, + const char *base_name, + lt_dlhandle *handle)); +static int find_module LT_PARAMS((lt_dlhandle *handle, + const char *dir, + const char *libdir, + const char *dlname, + const char *old_name, + int installed)); +static int free_vars LT_PARAMS((char *dlname, char *oldname, + char *libdir, char *deplibs)); +static int load_deplibs LT_PARAMS((lt_dlhandle handle, + char *deplibs)); +static int trim LT_PARAMS((char **dest, + const char *str)); +static int try_dlopen LT_PARAMS((lt_dlhandle *handle, + const char *filename)); +static int tryall_dlopen LT_PARAMS((lt_dlhandle *handle, + const char *filename)); +static int unload_deplibs LT_PARAMS((lt_dlhandle handle)); +static int lt_argz_insert LT_PARAMS((char **pargz, + size_t *pargz_len, + char *before, + const char *entry)); +static int lt_argz_insertinorder LT_PARAMS((char **pargz, + size_t *pargz_len, + const char *entry)); +static int lt_argz_insertdir LT_PARAMS((char **pargz, + size_t *pargz_len, + const char *dirnam, + struct dirent *dp)); +static int lt_dlpath_insertdir LT_PARAMS((char **ppath, + char *before, + const char *dir)); +static int list_files_by_dir LT_PARAMS((const char *dirnam, + char **pargz, + size_t *pargz_len)); +static int file_not_found LT_PARAMS((void)); + static char *user_search_path= 0; static lt_dlloader *loaders = 0; static lt_dlhandle handles = 0; @@ -1273,7 +1726,7 @@ lt_dlinit () { int errors = 0; - MUTEX_LOCK (); + LT_DLMUTEX_LOCK (); /* Initialize only at first call. */ if (++initialized == 1) @@ -1300,17 +1753,17 @@ lt_dlinit () if (presym_init (presym.dlloader_data)) { - MUTEX_SETERROR (LT_DLSTRERROR (INIT_LOADER)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INIT_LOADER)); ++errors; } else if (errors != 0) { - MUTEX_SETERROR (LT_DLSTRERROR (DLOPEN_NOT_SUPPORTED)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (DLOPEN_NOT_SUPPORTED)); ++errors; } } - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); return errors; } @@ -1327,16 +1780,14 @@ lt_dlpreload (preloaded) } else { - const char *errormsg = 0; - presym_free_symlists(); - - MUTEX_LOCK (); + + LT_DLMUTEX_LOCK (); if (default_preloaded_symbols) { errors = lt_dlpreload (default_preloaded_symbols); } - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); } return errors; @@ -1346,9 +1797,9 @@ int lt_dlpreload_default (preloaded) const lt_dlsymlist *preloaded; { - MUTEX_LOCK (); + LT_DLMUTEX_LOCK (); default_preloaded_symbols = preloaded; - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); return 0; } @@ -1357,15 +1808,14 @@ lt_dlexit () { /* shut down libltdl */ lt_dlloader *loader; - const char *errormsg; int errors = 0; - MUTEX_LOCK (); + LT_DLMUTEX_LOCK (); loader = loaders; if (!initialized) { - MUTEX_SETERROR (LT_DLSTRERROR (SHUTDOWN)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SHUTDOWN)); ++errors; goto done; } @@ -1421,7 +1871,7 @@ lt_dlexit () } done: - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); return errors; } @@ -1435,8 +1885,8 @@ tryall_dlopen (handle, filename) const char *saved_error; int errors = 0; - MUTEX_GETERROR (saved_error); - MUTEX_LOCK (); + LT_DLMUTEX_GETERROR (saved_error); + LT_DLMUTEX_LOCK (); cur = handles; loader = loaders; @@ -1469,10 +1919,9 @@ tryall_dlopen (handle, filename) cur = *handle; if (filename) { - cur->info.filename = strdup (filename); + cur->info.filename = lt_estrdup (filename); if (!cur->info.filename) { - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); ++errors; goto done; } @@ -1503,14 +1952,64 @@ tryall_dlopen (handle, filename) } cur->loader = loader; - last_error = saved_error; - + LT_DLMUTEX_SETERROR (saved_error); + done: - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); return errors; } +static int +tryall_dlopen_module (handle, prefix, dirname, dlname) + lt_dlhandle *handle; + const char *prefix; + const char *dirname; + const char *dlname; +{ + int error = 0; + char *filename = 0; + size_t filename_len = 0; + size_t dirname_len = LT_STRLEN (dirname); + + assert (handle); + assert (dirname); + assert (dlname); +#ifdef LT_DIRSEP_CHAR + /* Only canonicalized names (i.e. with DIRSEP chars already converted) + should make it into this function: */ + assert (strchr (dirname, LT_DIRSEP_CHAR) == 0); +#endif + + if (dirname[dirname_len -1] == '/') + --dirname_len; + filename_len = dirname_len + 1 + LT_STRLEN (dlname); + + /* Allocate memory, and combine DIRNAME and MODULENAME into it. + The PREFIX (if any) is handled below. */ + filename = LT_EMALLOC (char, dirname_len + 1 + filename_len + 1); + if (!filename) + return 1; + + sprintf (filename, "%.*s/%s", (int) dirname_len, dirname, dlname); + + /* Now that we have combined DIRNAME and MODULENAME, if there is + also a PREFIX to contend with, simply recurse with the arguments + shuffled. Otherwise, attempt to open FILENAME as a module. */ + if (prefix) + { + error += tryall_dlopen_module (handle, + (const char *) 0, prefix, filename); + } + else if (tryall_dlopen (handle, filename) != 0) + { + ++error; + } + + LT_DLFREE (filename); + return error; +} + static int find_module (handle, dir, libdir, dlname, old_name, installed) lt_dlhandle *handle; @@ -1520,252 +2019,302 @@ find_module (handle, dir, libdir, dlname, old_name, installed) const char *old_name; int installed; { - int error; - char *filename; - - /* try to open the old library first; if it was dlpreopened, + /* Try to open the old library first; if it was dlpreopened, we want the preopened version of it, even if a dlopenable - module is available */ - if (old_name && tryall_dlopen(handle, old_name) == 0) + module is available. */ + if (old_name && tryall_dlopen (handle, old_name) == 0) { return 0; } - /* try to open the dynamic library */ + /* Try to open the dynamic library. */ if (dlname) { - size_t len; - /* try to open the installed module */ if (installed && libdir) { - len = strlen (libdir) + 1 + strlen (dlname); - filename = LT_DLMALLOC (char, 1+ len); - - if (!filename) - { - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); - return 1; - } - - sprintf (filename, "%s/%s", libdir, dlname); - error = (tryall_dlopen (handle, filename) != 0); - LT_DLFREE (filename); - - if (!error) - { - return 0; - } + if (tryall_dlopen_module (handle, + (const char *) 0, libdir, dlname) == 0) + return 0; } /* try to open the not-installed module */ if (!installed) { - len = (dir ? strlen (dir) : 0) + strlen (objdir) + strlen (dlname); - filename = LT_DLMALLOC (char, 1+ len); - - if (!filename) - { - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); - return 1; - } - - if (dir) - { - strcpy (filename, dir); - } - else - { - *filename = 0; - } - strcat(filename, objdir); - strcat(filename, dlname); - - error = tryall_dlopen (handle, filename) != 0; - LT_DLFREE (filename); - if (!error) - { - return 0; - } + if (tryall_dlopen_module (handle, dir, objdir, dlname) == 0) + return 0; } /* maybe it was moved to another directory */ { - len = (dir ? strlen (dir) : 0) + strlen (dlname); - filename = LT_DLMALLOC (char, 1+ len); + if (tryall_dlopen_module (handle, + (const char *) 0, dir, dlname) == 0) + return 0; + } + } + + return 1; +} + + +static int +canonicalize_path (path, pcanonical) + const char *path; + char **pcanonical; +{ + char *canonical = 0; + + assert (path && *path); + assert (pcanonical); + + canonical = LT_EMALLOC (char, 1+ LT_STRLEN (path)); + if (!canonical) + return 1; - if (dir) + { + size_t dest = 0; + size_t src; + for (src = 0; path[src] != LT_EOS_CHAR; ++src) + { + /* Path separators are not copied to the beginning or end of + the destination, or if another separator would follow + immediately. */ + if (path[src] == LT_PATHSEP_CHAR) { - strcpy (filename, dir); + if ((dest == 0) + || (path[1+ src] == LT_PATHSEP_CHAR) + || (path[1+ src] == LT_EOS_CHAR)) + continue; } - else + + /* Anything other than a directory separator is copied verbatim. */ + if ((path[src] != '/') +#ifdef LT_DIRSEP_CHAR + && (path[src] != LT_DIRSEP_CHAR) +#endif + ) { - *filename = 0; + canonical[dest++] = path[src]; } - strcat(filename, dlname); - - error = (tryall_dlopen (handle, filename) != 0); - LT_DLFREE (filename); - if (!error) + /* Directory separators are converted and copied only if they are + not at the end of a path -- i.e. before a path separator or + NULL terminator. */ + else if ((path[1+ src] != LT_PATHSEP_CHAR) + && (path[1+ src] != LT_EOS_CHAR) +#ifdef LT_DIRSEP_CHAR + && (path[1+ src] != LT_DIRSEP_CHAR) +#endif + && (path[1+ src] != '/')) { - return 0; + canonical[dest++] = '/'; } } - } - return 1; + /* Add an end-of-string marker at the end. */ + canonical[dest] = LT_EOS_CHAR; + } + + /* Assign new value. */ + *pcanonical = canonical; + + return 0; } -static char* -canonicalize_path (path) +static int +argzize_path (path, pargz, pargz_len) const char *path; + char **pargz; + size_t *pargz_len; { - char *canonical = 0; + error_t error; - if (path && *path) - { - char *ptr = strdup (path); - canonical = ptr; + assert (path); + assert (pargz); + assert (pargz_len); -#ifdef LT_DIRSEP_CHAR - /* Avoid this overhead where '/' is the only separator. */ - while (ptr = strchr (ptr, LT_DIRSEP_CHAR)) + if ((error = argz_create_sep (path, LT_PATHSEP_CHAR, pargz, pargz_len))) + { + switch (error) { - *ptr++ = '/'; + case ENOMEM: + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + break; + default: + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (UNKNOWN)); + break; } -#endif + + return 1; } - return canonical; + return 0; } -static lt_ptr -find_file (basename, search_path, pdir, handle) - const char *basename; +/* Repeatedly call FUNC with each LT_PATHSEP_CHAR delimited element + of SEARCH_PATH and references to DATA1 and DATA2, until FUNC returns + non-zero or all elements are exhausted. If BASE_NAME is non-NULL, + it is appended to each SEARCH_PATH element before FUNC is called. */ +static int +foreach_dirinpath (search_path, base_name, func, data1, data2) const char *search_path; - char **pdir; - lt_dlhandle *handle; + const char *base_name; + foreach_callback_func *func; + lt_ptr data1; + lt_ptr data2; { - /* When handle != NULL search a library, otherwise a file - return NULL on failure, otherwise the file/handle. */ + int result = 0; + int filenamesize = 0; + size_t lenbase = LT_STRLEN (base_name); + size_t argz_len = 0; + char *argz = 0; + char *filename = 0; + char *canonical = 0; - lt_ptr result = 0; - char *filename = 0; - int filenamesize= 0; - int lenbase = strlen (basename); - char *canonical = 0; - char *next = 0; - - MUTEX_LOCK (); + LT_DLMUTEX_LOCK (); if (!search_path || !*search_path) { - MUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); goto cleanup; } - canonical = canonicalize_path (search_path); - if (!canonical) - { - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); - goto cleanup; - } + if (canonicalize_path (search_path, &canonical) != 0) + goto cleanup; - next = canonical; - while (next) - { - int lendir; - char *cur = next; + if (argzize_path (canonical, &argz, &argz_len) != 0) + goto cleanup; - next = strchr (cur, LT_PATHSEP_CHAR); - if (!next) - { - next = cur + strlen (cur); - } + { + char *dir_name = 0; + while ((dir_name = argz_next (argz, argz_len, dir_name))) + { + size_t lendir = LT_STRLEN (dir_name); - lendir = next - cur; - if (*next == LT_PATHSEP_CHAR) - { - ++next; - } - else + if (lendir +1 +lenbase >= filenamesize) { - next = 0; + LT_DLFREE (filename); + filenamesize = lendir +1 +lenbase +1; /* "/d" + '/' + "f" + '\0' */ + filename = LT_EMALLOC (char, filenamesize); + if (!filename) + goto cleanup; } - if (lendir == 0) - { - continue; - } + strncpy (filename, dir_name, lendir); + if (base_name && *base_name) + { + if (filename[lendir -1] != '/') + filename[lendir++] = '/'; + strcpy (filename +lendir, base_name); + } - if (lendir + 1 + lenbase >= filenamesize) - { - LT_DLFREE (filename); - filenamesize = lendir + 1 + lenbase + 1; - filename = LT_DLMALLOC (char, filenamesize); + if ((result = (*func) (filename, data1, data2))) + { + break; + } + } + } - if (!filename) - { - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); - goto cleanup; - } - } + cleanup: + LT_DLFREE (argz); + LT_DLFREE (canonical); + LT_DLFREE (filename); - strncpy(filename, cur, lendir); - if (filename[lendir-1] != '/') - { - filename[lendir++] = '/'; - } - strcpy(filename+lendir, basename); - if (handle) - { - if (tryall_dlopen (handle, filename) == 0) - { - result = (lt_ptr) handle; - goto cleanup; - } - } - else - { - FILE *file = fopen (filename, LT_READTEXT_MODE); - if (file) - { - LT_DLFREE (*pdir); + LT_DLMUTEX_UNLOCK (); - filename[lendir] = '\0'; - *pdir = strdup(filename); - if (!*pdir) - { - /* We could have even avoided the strdup, - but there would be some memory overhead. */ - *pdir = filename; - filename = 0; - } + return result; +} - result = (lt_ptr) file; - goto cleanup; - } - } +/* If FILEPATH can be opened, store the name of the directory component + in DATA1, and the opened FILE* structure address in DATA2. Otherwise + DATA1 is unchanged, but DATA2 is set to a pointer to NULL. */ +static int +find_file_callback (filename, data1, data2) + char *filename; + lt_ptr data1; + lt_ptr data2; +{ + char **pdir = (char **) data1; + FILE **pfile = (FILE **) data2; + int is_done = 0; + + assert (filename && *filename); + assert (pdir); + assert (pfile); + + if ((*pfile = fopen (filename, LT_READTEXT_MODE))) + { + char *dirend = strrchr (filename, '/'); + + if (dirend > filename) + *dirend = LT_EOS_CHAR; + + LT_DLFREE (*pdir); + *pdir = lt_estrdup (filename); + is_done = (*pdir == 0) ? -1 : 1; } - MUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + return is_done; +} - cleanup: - LT_DLFREE (filename); - LT_DLFREE (canonical); +static FILE * +find_file (search_path, base_name, pdir) + const char *search_path; + const char *base_name; + char **pdir; +{ + FILE *file = 0; - MUTEX_UNLOCK (); + foreach_dirinpath (search_path, base_name, find_file_callback, pdir, &file); - return result; + return file; +} + +static int +find_handle_callback (filename, data, ignored) + char *filename; + lt_ptr data; + lt_ptr ignored; +{ + lt_dlhandle *handle = (lt_dlhandle *) data; + int notfound = access (filename, R_OK); + + /* Bail out if file cannot be read... */ + if (notfound) + return 0; + + /* Try to dlopen the file, but do not continue searching in any + case. */ + if (tryall_dlopen (handle, filename) != 0) + *handle = 0; + + return 1; +} + +/* If HANDLE was found return it, otherwise return 0. If HANDLE was + found but could not be opened, *HANDLE will be set to 0. */ +static lt_dlhandle * +find_handle (search_path, base_name, handle) + const char *search_path; + const char *base_name; + lt_dlhandle *handle; +{ + if (!search_path) + return 0; + + if (!foreach_dirinpath (search_path, base_name, find_handle_callback, + handle, 0)) + return 0; + + return handle; } static int -load_deplibs(handle, deplibs) +load_deplibs (handle, deplibs) lt_dlhandle handle; char *deplibs; { #if LTDL_DLOPEN_DEPLIBS - char *p, *save_search_path; + char *p, *save_search_path = 0; int depcount = 0; int i; char **names = 0; @@ -1781,12 +2330,12 @@ load_deplibs(handle, deplibs) } ++errors; - MUTEX_LOCK (); - save_search_path = strdup (user_search_path); - if (user_search_path && !save_search_path) + LT_DLMUTEX_LOCK (); + if (user_search_path) { - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); - goto cleanup; + save_search_path = lt_estrdup (user_search_path); + if (!save_search_path) + goto cleanup; } /* extract search paths and count deplibs */ @@ -1828,7 +2377,7 @@ load_deplibs(handle, deplibs) LT_DLFREE (user_search_path); user_search_path = save_search_path; - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); if (!depcount) { @@ -1836,11 +2385,9 @@ load_deplibs(handle, deplibs) goto cleanup; } - names = LT_DLMALLOC (char *, depcount * sizeof (char*)); + names = LT_EMALLOC (char *, depcount * sizeof (char*)); if (!names) - { - goto cleanup; - } + goto cleanup; /* now only extract the actual deplibs */ depcount = 0; @@ -1866,25 +2413,18 @@ load_deplibs(handle, deplibs) *end = 0; /* set a temporary string terminator */ if (strncmp(p, "-l", 2) == 0) { - name = LT_DLMALLOC (char, 3+ /* "lib" */ strlen (p+2) + 1); + size_t name_len = 3+ /* "lib" */ LT_STRLEN (p + 2); + name = LT_EMALLOC (char, 1+ name_len); if (name) - { - sprintf (name, "lib%s", p+2); - } + sprintf (name, "lib%s", p+2); } else - { - name = strdup(p); - } + name = lt_estrdup(p); - if (name) - { - names[depcount++] = name; - } - else - { - goto cleanup_names; - } + if (!name) + goto cleanup_names; + + names[depcount++] = name; *end = save; } p = end; @@ -1900,11 +2440,9 @@ load_deplibs(handle, deplibs) { int j = 0; - handle->deplibs = (lt_dlhandle*) LT_DLMALLOC (lt_dlhandle *, depcount); + handle->deplibs = (lt_dlhandle*) LT_EMALLOC (lt_dlhandle *, depcount); if (!handle->deplibs) - { - goto cleanup; - } + goto cleanup; for (i = 0; i < depcount; ++i) { @@ -1933,7 +2471,7 @@ load_deplibs(handle, deplibs) } static int -unload_deplibs(handle) +unload_deplibs (handle) lt_dlhandle handle; { int i; @@ -1961,22 +2499,19 @@ trim (dest, str) /* remove the leading and trailing "'" from str and store the result in dest */ const char *end = strrchr (str, '\''); - int len = strlen (str); + size_t len = LT_STRLEN (str); char *tmp; LT_DLFREE (*dest); if (len > 3 && str[0] == '\'') { - tmp = LT_DLMALLOC (char, end - str); + tmp = LT_EMALLOC (char, end - str); if (!tmp) - { - last_error = LT_DLSTRERROR (NO_MEMORY); - return 1; - } + return 1; strncpy(tmp, &str[1], (end - str) - 1); - tmp[len-3] = '\0'; + tmp[len-3] = LT_EOS_CHAR; *dest = tmp; } else @@ -1988,7 +2523,7 @@ trim (dest, str) } static int -free_vars( dlname, oldname, libdir, deplibs) +free_vars (dlname, oldname, libdir, deplibs) char *dlname; char *oldname; char *libdir; @@ -2002,86 +2537,93 @@ free_vars( dlname, oldname, libdir, deplibs) return 0; } -lt_dlhandle -lt_dlopen (filename) +static int +try_dlopen (phandle, filename) + lt_dlhandle *phandle; const char *filename; { - lt_dlhandle handle = 0, newhandle; - const char *ext; - const char *saved_error; - char *canonical = 0, *basename = 0, *dir = 0, *name = 0; + const char * ext = 0; + const char * saved_error = 0; + char * canonical = 0; + char * base_name = 0; + char * dir = 0; + char * name = 0; + int errors = 0; + lt_dlhandle newhandle; - MUTEX_GETERROR (saved_error); + assert (phandle); + assert (*phandle == 0); + + LT_DLMUTEX_GETERROR (saved_error); /* dlopen self? */ if (!filename) { - handle = (lt_dlhandle) LT_DLMALLOC (struct lt_dlhandle_struct, 1); - if (!handle) - { - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); - return 0; - } + *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1); + if (*phandle == 0) + return 1; - handle->info.ref_count = 0; - handle->depcount = 0; - handle->deplibs = 0; - handle->caller_data = 0; - newhandle = handle; + memset (*phandle, 0, sizeof(struct lt_dlhandle_struct)); + newhandle = *phandle; /* lt_dlclose()ing yourself is very bad! Disallow it. */ - LT_DLSET_FLAG (handle, LT_DLRESIDENT_FLAG); + LT_DLSET_FLAG (*phandle, LT_DLRESIDENT_FLAG); if (tryall_dlopen (&newhandle, 0) != 0) { - LT_DLFREE (handle); - return 0; + LT_DLFREE (*phandle); + return 1; } + goto register_handle; } - canonical = canonicalize_path (filename); - if (!canonical) + assert (filename && *filename); + + /* Doing this immediately allows internal functions to safely + assume only canonicalized paths are passed. */ + if (canonicalize_path (filename, &canonical) != 0) { - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); - LT_DLFREE (handle); - return 0; + ++errors; + goto cleanup; } /* If the canonical module name is a path (relative or absolute) then split it into a directory part and a name part. */ - basename = strrchr (canonical, '/'); - if (basename) + base_name = strrchr (canonical, '/'); + if (base_name) { - ++basename; - dir = LT_DLMALLOC (char, basename - canonical + 1); + size_t dirlen = (1+ base_name) - canonical; + + dir = LT_EMALLOC (char, 1+ dirlen); if (!dir) { - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); - handle = 0; + ++errors; goto cleanup; } - strncpy (dir, canonical, basename - canonical); - dir[basename - canonical] = '\0'; + strncpy (dir, canonical, dirlen); + dir[dirlen] = LT_EOS_CHAR; + + ++base_name; } else - { - basename = canonical; - } + LT_DLMEM_REASSIGN (base_name, canonical); + + assert (base_name && *base_name); /* Check whether we are opening a libtool module (.la extension). */ - ext = strrchr(basename, '.'); - if (ext && strcmp(ext, ".la") == 0) + ext = strrchr (base_name, '.'); + if (ext && strcmp (ext, archive_ext) == 0) { /* this seems to be a libtool module */ - FILE *file = 0; - int i; - char *dlname = 0, *old_name = 0; - char *libdir = 0, *deplibs = 0; - char *line; + FILE * file = 0; + char * dlname = 0; + char * old_name = 0; + char * libdir = 0; + char * deplibs = 0; + char * line = 0; size_t line_len; - int error = 0; /* if we can't find the installed flag, it is probably an installed libtool archive, produced with an old version @@ -2089,53 +2631,63 @@ lt_dlopen (filename) int installed = 1; /* extract the module name from the file name */ - name = LT_DLMALLOC (char, ext - basename + 1); + name = LT_EMALLOC (char, ext - base_name + 1); if (!name) { - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); - handle = 0; + ++errors; goto cleanup; } /* canonicalize the module name */ - for (i = 0; i < ext - basename; ++i) - { - if (isalnum ((int)(basename[i]))) - { - name[i] = basename[i]; - } - else - { - name[i] = '_'; - } - } - - name[ext - basename] = '\0'; + { + size_t i; + for (i = 0; i < ext - base_name; ++i) + { + if (isalnum ((int)(base_name[i]))) + { + name[i] = base_name[i]; + } + else + { + name[i] = '_'; + } + } + name[ext - base_name] = LT_EOS_CHAR; + } - /* Now try to open the .la file. If there is no directory name - component, try to find it first in user_search_path and then other - prescribed paths. Otherwise (or in any case if the module was not - yet found) try opening just the module name as passed. */ + /* Now try to open the .la file. If there is no directory name + component, try to find it first in user_search_path and then other + prescribed paths. Otherwise (or in any case if the module was not + yet found) try opening just the module name as passed. */ if (!dir) { - file = (FILE*) find_file(basename, user_search_path, &dir, 0); + const char *search_path; + + LT_DLMUTEX_LOCK (); + search_path = user_search_path; + if (search_path) + file = find_file (user_search_path, base_name, &dir); + LT_DLMUTEX_UNLOCK (); + if (!file) { - file = (FILE*) find_file(basename, getenv("LTDL_LIBRARY_PATH"), - &dir, 0); + search_path = getenv (LTDL_SEARCHPATH_VAR); + if (search_path) + file = find_file (search_path, base_name, &dir); } #ifdef LTDL_SHLIBPATH_VAR if (!file) { - file = (FILE*) find_file(basename, getenv(LTDL_SHLIBPATH_VAR), - &dir, 0); + search_path = getenv (LTDL_SHLIBPATH_VAR); + if (search_path) + file = find_file (search_path, base_name, &dir); } #endif #ifdef LTDL_SYSSEARCHPATH - if (!file) + if (!file && sys_search_path) { - file = (FILE*) find_file(basename, sys_search_path, &dir, 0); + file = find_file (sys_search_path, base_name, &dir); } #endif } @@ -2143,42 +2695,39 @@ lt_dlopen (filename) { file = fopen (filename, LT_READTEXT_MODE); } - if (!file) - { - MUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); - } + /* If we didn't find the file by now, it really isn't there. Set + the status flag, and bail out. */ if (!file) { - handle = 0; + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + ++errors; goto cleanup; } line_len = LT_FILENAME_MAX; - line = LT_DLMALLOC (char, line_len); + line = LT_EMALLOC (char, line_len); if (!line) { fclose (file); - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); - handle = 0; + ++errors; goto cleanup; } /* read the .la file */ - while (!feof(file)) + while (!feof (file)) { - if (!fgets (line, line_len, file)) + if (!fgets (line, (int) line_len, file)) { break; } - - /* Handle the case where we occasionally need to read a line + /* Handle the case where we occasionally need to read a line that is longer than the initial buffer size. */ - while (line[strlen(line) -1] != '\n') + while (line[LT_STRLEN(line) -1] != '\n') { line = LT_DLREALLOC (char, line, line_len *2); - if (!fgets (&line[line_len -1], line_len +1, file)) + if (!fgets (&line[line_len -1], (int) line_len +1, file)) { break; } @@ -2194,7 +2743,7 @@ lt_dlopen (filename) #define STR_DLNAME "dlname=" if (strncmp (line, STR_DLNAME, sizeof (STR_DLNAME) - 1) == 0) { - error = trim (&dlname, &line[sizeof (STR_DLNAME) - 1]); + errors += trim (&dlname, &line[sizeof (STR_DLNAME) - 1]); } #undef STR_OLD_LIBRARY @@ -2202,13 +2751,13 @@ lt_dlopen (filename) else if (strncmp (line, STR_OLD_LIBRARY, sizeof (STR_OLD_LIBRARY) - 1) == 0) { - error = trim (&old_name, &line[sizeof (STR_OLD_LIBRARY) - 1]); + errors += trim (&old_name, &line[sizeof (STR_OLD_LIBRARY) - 1]); } #undef STR_LIBDIR #define STR_LIBDIR "libdir=" else if (strncmp (line, STR_LIBDIR, sizeof (STR_LIBDIR) - 1) == 0) { - error = trim (&libdir, &line[sizeof(STR_LIBDIR) - 1]); + errors += trim (&libdir, &line[sizeof(STR_LIBDIR) - 1]); } #undef STR_DL_DEPLIBS @@ -2216,7 +2765,7 @@ lt_dlopen (filename) else if (strncmp (line, STR_DL_DEPLIBS, sizeof (STR_DL_DEPLIBS) - 1) == 0) { - error = trim (&deplibs, &line[sizeof (STR_DL_DEPLIBS) - 1]); + errors += trim (&deplibs, &line[sizeof (STR_DL_DEPLIBS) - 1]); } else if (strcmp (line, "installed=yes\n") == 0) { @@ -2233,210 +2782,490 @@ lt_dlopen (filename) sizeof (STR_LIBRARY_NAMES) - 1) == 0) { char *last_libname; - error = trim (&dlname, &line[sizeof (STR_LIBRARY_NAMES) - 1]); - if (! error && dlname && - (last_libname = strrchr (dlname, ' ')) != NULL) + errors += trim (&dlname, &line[sizeof (STR_LIBRARY_NAMES) - 1]); + if (!errors + && dlname + && (last_libname = strrchr (dlname, ' ')) != 0) { - last_libname = strdup (last_libname + 1); + last_libname = lt_estrdup (last_libname + 1); + if (!last_libname) + { + ++errors; + goto cleanup; + } LT_DLMEM_REASSIGN (dlname, last_libname); } } - if (error) - { - break; - } + if (errors) + break; } fclose (file); LT_DLFREE (line); /* allocate the handle */ - handle = (lt_dlhandle) LT_DLMALLOC (struct lt_dlhandle_struct, 1); - if (!handle || error) - { - LT_DLFREE (handle); - if (!error) - { - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); - } + *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1); + if (*phandle == 0) + ++errors; + if (errors) + { free_vars (dlname, old_name, libdir, deplibs); - /* handle is already set to 0 */ + LT_DLFREE (*phandle); goto cleanup; } - handle->info.ref_count = 0; - if (load_deplibs (handle, deplibs) == 0) + assert (*phandle); + + memset (*phandle, 0, sizeof(struct lt_dlhandle_struct)); + if (load_deplibs (*phandle, deplibs) == 0) { - newhandle = handle; + newhandle = *phandle; /* find_module may replace newhandle */ if (find_module (&newhandle, dir, libdir, dlname, old_name, installed)) { - unload_deplibs (handle); - error = 1; + unload_deplibs (*phandle); + ++errors; } } else { - error = 1; + ++errors; } free_vars (dlname, old_name, libdir, deplibs); - if (error) + if (errors) { - LT_DLFREE (handle); + LT_DLFREE (*phandle); goto cleanup; } - if (handle != newhandle) + if (*phandle != newhandle) { - unload_deplibs (handle); + unload_deplibs (*phandle); } } else { /* not a libtool module */ - handle = (lt_dlhandle) LT_DLMALLOC (struct lt_dlhandle_struct, 1); - if (!handle) + *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1); + if (*phandle == 0) { - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); - /* handle is already set to 0 */ + ++errors; goto cleanup; } - handle->info.ref_count = 0; - /* non-libtool modules don't have dependencies */ - handle->depcount = 0; - handle->deplibs = 0; - newhandle = handle; + + memset (*phandle, 0, sizeof (struct lt_dlhandle_struct)); + newhandle = *phandle; /* If the module has no directory name component, try to find it first in user_search_path and then other prescribed paths. Otherwise (or in any case if the module was not yet found) try opening just the module name as passed. */ - if ((dir || (!find_file (basename, user_search_path, 0, &newhandle) - && !find_file (basename, getenv ("LTDL_LIBRARY_PATH"), - 0, &newhandle) + if ((dir || (!find_handle (user_search_path, base_name, &newhandle) + && !find_handle (getenv (LTDL_SEARCHPATH_VAR), base_name, + &newhandle) #ifdef LTDL_SHLIBPATH_VAR - && !find_file (basename, getenv (LTDL_SHLIBPATH_VAR), - 0, &newhandle) + && !find_handle (getenv (LTDL_SHLIBPATH_VAR), base_name, + &newhandle) #endif #ifdef LTDL_SYSSEARCHPATH - && !find_file (basename, sys_search_path, 0, &newhandle) + && !find_handle (sys_search_path, base_name, &newhandle) #endif - )) && tryall_dlopen (&newhandle, filename)) + ))) { - LT_DLFREE (handle); + tryall_dlopen (&newhandle, filename); + } + + if (!newhandle) + { + LT_DLFREE (*phandle); + ++errors; goto cleanup; } } register_handle: - LT_DLMEM_REASSIGN (handle, newhandle); + LT_DLMEM_REASSIGN (*phandle, newhandle); - if (handle->info.ref_count == 0) + if ((*phandle)->info.ref_count == 0) { - handle->info.ref_count = 1; - handle->info.name = name; - handle->next = handles; + (*phandle)->info.ref_count = 1; + LT_DLMEM_REASSIGN ((*phandle)->info.name, name); - MUTEX_LOCK (); - handles = handle; - MUTEX_UNLOCK (); - - name = 0; /* don't free this during `cleanup' */ + LT_DLMUTEX_LOCK (); + (*phandle)->next = handles; + handles = *phandle; + LT_DLMUTEX_UNLOCK (); } - MUTEX_SETERROR (saved_error); + LT_DLMUTEX_SETERROR (saved_error); cleanup: LT_DLFREE (dir); LT_DLFREE (name); LT_DLFREE (canonical); + return errors; +} + +lt_dlhandle +lt_dlopen (filename) + const char *filename; +{ + lt_dlhandle handle = 0; + + /* Just incase we missed a code path in try_dlopen() that reports + an error, but forgets to reset handle... */ + if (try_dlopen (&handle, filename) != 0) + return 0; + return handle; } +/* If the last error messge store was `FILE_NOT_FOUND', then return + non-zero. */ +static int +file_not_found () +{ + const char *error = 0; + + LT_DLMUTEX_GETERROR (error); + if (error == LT_DLSTRERROR (FILE_NOT_FOUND)) + return 1; + + return 0; +} + +/* If FILENAME has an ARCHIVE_EXT or SHLIB_EXT extension, try to + open the FILENAME as passed. Otherwise try appending ARCHIVE_EXT, + and if a file is still not found try again with SHLIB_EXT appended + instead. */ lt_dlhandle lt_dlopenext (filename) const char *filename; { - lt_dlhandle handle; - char *tmp; - int len; - const char *saved_error; - - MUTEX_GETERROR (saved_error); + lt_dlhandle handle = 0; + char * tmp = 0; + char * ext = 0; + size_t len; + int errors = 0; if (!filename) { return lt_dlopen (filename); } - len = strlen (filename); - if (!len) + assert (filename); + + len = LT_STRLEN (filename); + ext = strrchr (filename, '.'); + + /* If FILENAME already bears a suitable extension, there is no need + to try appending additional extensions. */ + if (ext && ((strcmp (ext, archive_ext) == 0) +#ifdef LTDL_SHLIB_EXT + || (strcmp (ext, shlib_ext) == 0) +#endif + )) { - MUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); - return 0; + return lt_dlopen (filename); } - /* try "filename.la" */ - tmp = LT_DLMALLOC (char, len+4); + /* First try appending ARCHIVE_EXT. */ + tmp = LT_EMALLOC (char, len + LT_STRLEN (archive_ext) + 1); if (!tmp) - { - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); - return 0; - } + return 0; + strcpy (tmp, filename); - strcat (tmp, ".la"); - handle = lt_dlopen (tmp); - if (handle) + strcat (tmp, archive_ext); + errors = try_dlopen (&handle, tmp); + + /* If we found FILENAME, stop searching -- whether we were able to + load the file as a module or not. If the file exists but loading + failed, it is better to return an error message here than to + report FILE_NOT_FOUND when the alternatives (foo.so etc) are not + in the module search path. */ + if (handle || ((errors > 0) && file_not_found ())) { - MUTEX_SETERROR (saved_error); LT_DLFREE (tmp); return handle; } #ifdef LTDL_SHLIB_EXT - /* try "filename.EXT" */ - if (strlen(shlib_ext) > 3) + /* Try appending SHLIB_EXT. */ + if (LT_STRLEN (shlib_ext) > LT_STRLEN (archive_ext)) { LT_DLFREE (tmp); - tmp = LT_DLMALLOC (char, len + strlen (shlib_ext) + 1); + tmp = LT_EMALLOC (char, len + LT_STRLEN (shlib_ext) + 1); if (!tmp) - { - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); - return 0; - } + return 0; + strcpy (tmp, filename); } else { - tmp[len] = '\0'; + tmp[len] = LT_EOS_CHAR; } strcat(tmp, shlib_ext); - handle = lt_dlopen (tmp); - if (handle) + errors = try_dlopen (&handle, tmp); + + /* As before, if the file was found but loading failed, return now + with the current error message. */ + if (handle || ((errors > 0) && file_not_found ())) { - MUTEX_SETERROR (saved_error); LT_DLFREE (tmp); return handle; } #endif - /* try the normal file name */ - handle = lt_dlopen (filename); - if (handle) + /* Still here? Then we really did fail to locate any of the file + names we tried. */ + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + LT_DLFREE (tmp); + return 0; +} + + +static int +lt_argz_insert (pargz, pargz_len, before, entry) + char **pargz; + size_t *pargz_len; + char *before; + const char *entry; +{ + error_t error; + + if ((error = argz_insert (pargz, pargz_len, before, entry))) { - return handle; + switch (error) + { + case ENOMEM: + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + break; + default: + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (UNKNOWN)); + break; + } + return 1; } - MUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); - LT_DLFREE (tmp); return 0; } +static int +lt_argz_insertinorder (pargz, pargz_len, entry) + char **pargz; + size_t *pargz_len; + const char *entry; +{ + char *before = 0; + + assert (pargz); + assert (pargz_len); + assert (entry && *entry); + + if (*pargz) + while ((before = argz_next (*pargz, *pargz_len, before))) + { + int cmp = strcmp (entry, before); + + if (cmp < 0) break; + if (cmp == 0) return 0; /* No duplicates! */ + } + + return lt_argz_insert (pargz, pargz_len, before, entry); +} + +static int +lt_argz_insertdir (pargz, pargz_len, dirnam, dp) + char **pargz; + size_t *pargz_len; + const char *dirnam; + struct dirent *dp; +{ + char *buf = 0; + size_t buf_len = 0; + char *end = 0; + size_t end_offset = 0; + size_t dir_len = 0; + int errors = 0; + + assert (pargz); + assert (pargz_len); + assert (dp); + + dir_len = LT_STRLEN (dirnam); + end = dp->d_name + LT_D_NAMLEN(dp); + + /* Ignore version numbers. */ + { + char *p; + for (p = end; p -1 > dp->d_name; --p) + if (strchr (".0123456789", p[-1]) == 0) + break; + + if (*p == '.') + end = p; + } + + /* Ignore filename extension. */ + { + char *p; + for (p = end -1; p > dp->d_name; --p) + if (*p == '.') + { + end = p; + break; + } + } + + /* Prepend the directory name. */ + end_offset = end - dp->d_name; + buf_len = dir_len + 1+ end_offset; + buf = LT_EMALLOC (char, 1+ buf_len); + if (!buf) + return ++errors; + + assert (buf); + + strcpy (buf, dirnam); + strcat (buf, "/"); + strncat (buf, dp->d_name, end_offset); + buf[buf_len] = LT_EOS_CHAR; + + /* Try to insert (in order) into ARGZ/ARGZ_LEN. */ + if (lt_argz_insertinorder (pargz, pargz_len, buf) != 0) + ++errors; + + LT_DLFREE (buf); + + return errors; +} + +static int +list_files_by_dir (dirnam, pargz, pargz_len) + const char *dirnam; + char **pargz; + size_t *pargz_len; +{ + DIR *dirp = 0; + int errors = 0; + + assert (dirnam && *dirnam); + assert (pargz); + assert (pargz_len); + assert (dirnam[LT_STRLEN(dirnam) -1] != '/'); + + dirp = opendir (dirnam); + if (dirp) + { + struct dirent *dp = 0; + + while ((dp = readdir (dirp))) + if (dp->d_name[0] != '.') + if (lt_argz_insertdir (pargz, pargz_len, dirnam, dp)) + { + ++errors; + break; + } + + closedir (dirp); + } + else + ++errors; + + return errors; +} + + +/* If there are any files in DIRNAME, call the function passed in + DATA1 (with the name of each file and DATA2 as arguments). */ +static int +foreachfile_callback (dirname, data1, data2) + char *dirname; + lt_ptr data1; + lt_ptr data2; +{ + int (*func) LT_PARAMS((const char *filename, lt_ptr data)) + = (int (*) LT_PARAMS((const char *filename, lt_ptr data))) data1; + + int is_done = 0; + char *argz = 0; + size_t argz_len = 0; + + if (list_files_by_dir (dirname, &argz, &argz_len) != 0) + goto cleanup; + if (!argz) + goto cleanup; + + { + char *filename = 0; + while ((filename = argz_next (argz, argz_len, filename))) + if ((is_done = (*func) (filename, data2))) + break; + } + + cleanup: + LT_DLFREE (argz); + + return is_done; +} + + +/* Call FUNC for each unique extensionless file in SEARCH_PATH, along + with DATA. The filenames passed to FUNC would be suitable for + passing to lt_dlopenext. The extensions are stripped so that + individual modules do not generate several entries (e.g. libfoo.la, + libfoo.so, libfoo.so.1, libfoo.so.1.0.0). If SEARCH_PATH is NULL, + then the same directories that lt_dlopen would search are examined. */ +int +lt_dlforeachfile (search_path, func, data) + const char *search_path; + int (*func) LT_PARAMS ((const char *filename, lt_ptr data)); + lt_ptr data; +{ + int is_done = 0; + + if (search_path) + { + /* If a specific path was passed, search only the directories + listed in it. */ + is_done = foreach_dirinpath (search_path, 0, + foreachfile_callback, func, data); + } + else + { + /* Otherwise search the default paths. */ + is_done = foreach_dirinpath (user_search_path, 0, + foreachfile_callback, func, data); + if (!is_done) + { + is_done = foreach_dirinpath (getenv("LTDL_LIBRARY_PATH"), 0, + foreachfile_callback, func, data); + } + +#ifdef LTDL_SHLIBPATH_VAR + if (!is_done) + { + is_done = foreach_dirinpath (getenv(LTDL_SHLIBPATH_VAR), 0, + foreachfile_callback, func, data); + } +#endif +#ifdef LTDL_SYSSEARCHPATH + if (!is_done) + { + is_done = foreach_dirinpath (getenv(LTDL_SYSSEARCHPATH), 0, + foreachfile_callback, func, data); + } +#endif + } + + return is_done; +} + int lt_dlclose (handle) lt_dlhandle handle; @@ -2444,7 +3273,7 @@ lt_dlclose (handle) lt_dlhandle cur, last; int errors = 0; - MUTEX_LOCK (); + LT_DLMUTEX_LOCK (); /* check whether the handle is valid */ last = cur = handles; @@ -2456,7 +3285,7 @@ lt_dlclose (handle) if (!cur) { - MUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); ++errors; goto done; } @@ -2483,6 +3312,9 @@ lt_dlclose (handle) errors += handle->loader->module_close (data, handle->module); errors += unload_deplibs(handle); + /* It is up to the callers to free the data itself. */ + LT_DLFREE (handle->caller_data); + LT_DLFREE (handle->info.filename); LT_DLFREE (handle->info.name); LT_DLFREE (handle); @@ -2492,12 +3324,12 @@ lt_dlclose (handle) if (LT_DLIS_RESIDENT (handle)) { - MUTEX_SETERROR (LT_DLSTRERROR (CLOSE_RESIDENT_MODULE)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CLOSE_RESIDENT_MODULE)); ++errors; } done: - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); return errors; } @@ -2507,7 +3339,7 @@ lt_dlsym (handle, symbol) lt_dlhandle handle; const char *symbol; { - int lensym; + size_t lensym; char lsym[LT_SYMBOL_LENGTH]; char *sym; lt_ptr address; @@ -2515,26 +3347,18 @@ lt_dlsym (handle, symbol) if (!handle) { - MUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); return 0; } if (!symbol) { - MUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); return 0; } - lensym = strlen(symbol); - if (handle->loader->sym_prefix) - { - lensym += strlen(handle->loader->sym_prefix); - } - - if (handle->info.name) - { - lensym += strlen(handle->info.name); - } + lensym = LT_STRLEN (symbol) + LT_STRLEN (handle->loader->sym_prefix) + + LT_STRLEN (handle->info.name); if (lensym + LT_SYMBOL_OVERHEAD < LT_SYMBOL_LENGTH) { @@ -2542,13 +3366,12 @@ lt_dlsym (handle, symbol) } else { - sym = LT_DLMALLOC (char, lensym + LT_SYMBOL_OVERHEAD + 1); - } - - if (!sym) - { - MUTEX_SETERROR (LT_DLSTRERROR (BUFFER_OVERFLOW)); - return 0; + sym = LT_EMALLOC (char, lensym + LT_SYMBOL_OVERHEAD + 1); + if (!sym) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (BUFFER_OVERFLOW)); + return 0; + } } data = handle->loader->dlloader_data; @@ -2556,7 +3379,7 @@ lt_dlsym (handle, symbol) { const char *saved_error; - MUTEX_GETERROR (saved_error); + LT_DLMUTEX_GETERROR (saved_error); /* this is a libtool module */ if (handle->loader->sym_prefix) @@ -2582,7 +3405,7 @@ lt_dlsym (handle, symbol) } return address; } - MUTEX_SETERROR (saved_error); + LT_DLMUTEX_SETERROR (saved_error); } /* otherwise try "symbol" */ @@ -2610,10 +3433,82 @@ lt_dlerror () { const char *error; - MUTEX_GETERROR (error); - MUTEX_SETERROR (0); + LT_DLMUTEX_GETERROR (error); + LT_DLMUTEX_SETERROR (0); - return error; + return error ? error : LT_DLSTRERROR (UNKNOWN); +} + +static int +lt_dlpath_insertdir (ppath, before, dir) + char **ppath; + char *before; + const char *dir; +{ + int errors = 0; + char *canonical = 0; + char *argz = 0; + size_t argz_len = 0; + + assert (ppath); + assert (dir && *dir); + + if (canonicalize_path (dir, &canonical) != 0) + { + ++errors; + goto cleanup; + } + + assert (canonical && *canonical); + + /* If *PPATH is empty, set it to DIR. */ + if (*ppath == 0) + { + assert (!before); /* BEFORE cannot be set without PPATH. */ + assert (dir); /* Without DIR, don't call this function! */ + + *ppath = lt_estrdup (dir); + if (*ppath == 0) + ++errors; + + return errors; + } + + assert (ppath && *ppath); + + if (argzize_path (*ppath, &argz, &argz_len) != 0) + { + ++errors; + goto cleanup; + } + + /* Convert BEFORE into an equivalent offset into ARGZ. This only works + if *PPATH is already canonicalized, and hence does not change length + with respect to ARGZ. We canonicalize each entry as it is added to + the search path, and don't call this function with (uncanonicalized) + user paths, so this is a fair assumption. */ + if (before) + { + assert (*ppath <= before); + assert (before - *ppath <= strlen (*ppath)); + + before = before - *ppath + argz; + } + + if (lt_argz_insert (&argz, &argz_len, before, dir) != 0) + { + ++errors; + goto cleanup; + } + + argz_stringify (argz, argz_len, LT_PATHSEP_CHAR); + LT_DLMEM_REASSIGN (*ppath, argz); + + cleanup: + LT_DLFREE (canonical); + LT_DLFREE (argz); + + return errors; } int @@ -2622,40 +3517,47 @@ lt_dladdsearchdir (search_dir) { int errors = 0; - if (!search_dir || !strlen(search_dir)) + if (search_dir && *search_dir) { - return errors; + LT_DLMUTEX_LOCK (); + if (lt_dlpath_insertdir (&user_search_path, 0, search_dir) != 0) + ++errors; + LT_DLMUTEX_UNLOCK (); } - MUTEX_LOCK (); - if (!user_search_path) + return errors; +} + +int +lt_dlinsertsearchdir (before, search_dir) + const char *before; + const char *search_dir; +{ + int errors = 0; + + if (before) { - user_search_path = strdup (search_dir); - if (!user_search_path) + LT_DLMUTEX_LOCK (); + if ((before < user_search_path) + || (before >= user_search_path + LT_STRLEN (user_search_path))) { - last_error = LT_DLSTRERROR (NO_MEMORY); - ++errors; + LT_DLMUTEX_UNLOCK (); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_POSITION)); + return 1; } + LT_DLMUTEX_UNLOCK (); } - else - { - size_t len = strlen (user_search_path) + 1 + strlen (search_dir); - char *new_search_path = LT_DLMALLOC (char, 1+ len); - if (!new_search_path) + if (search_dir && *search_dir) + { + LT_DLMUTEX_LOCK (); + if (lt_dlpath_insertdir (&user_search_path, + (char *) before, search_dir) != 0) { - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); ++errors; } - else - { - sprintf (new_search_path, "%s%c%s", user_search_path, - LT_PATHSEP_CHAR, search_dir); - - LT_DLMEM_REASSIGN (user_search_path, new_search_path); - } + LT_DLMUTEX_UNLOCK (); } - MUTEX_UNLOCK (); return errors; } @@ -2664,24 +3566,21 @@ int lt_dlsetsearchpath (search_path) const char *search_path; { - int errors = 0; + int errors = 0; - MUTEX_LOCK (); + LT_DLMUTEX_LOCK (); LT_DLFREE (user_search_path); - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); - if (!search_path || !strlen (search_path)) + if (!search_path || !LT_STRLEN (search_path)) { return errors; } - MUTEX_LOCK (); - user_search_path = strdup (search_path); - if (!user_search_path) - { - ++errors; - } - MUTEX_UNLOCK (); + LT_DLMUTEX_LOCK (); + if (canonicalize_path (search_path, &user_search_path) != 0) + ++errors; + LT_DLMUTEX_UNLOCK (); return errors; } @@ -2691,9 +3590,9 @@ lt_dlgetsearchpath () { const char *saved_path; - MUTEX_LOCK (); + LT_DLMUTEX_LOCK (); saved_path = user_search_path; - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); return saved_path; } @@ -2706,7 +3605,7 @@ lt_dlmakeresident (handle) if (!handle) { - MUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); ++errors; } else @@ -2723,7 +3622,7 @@ lt_dlisresident (handle) { if (!handle) { - MUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); return -1; } @@ -2741,7 +3640,7 @@ lt_dlgetinfo (handle) { if (!handle) { - MUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); return 0; } @@ -2752,7 +3651,7 @@ lt_dlhandle lt_dlhandle_next (place) lt_dlhandle place; { - return place ? place->next : (lt_dlhandle) 0; + return place ? place->next : handles; } int @@ -2763,7 +3662,7 @@ lt_dlforeach (func, data) int errors = 0; lt_dlhandle cur; - MUTEX_LOCK (); + LT_DLMUTEX_LOCK (); cur = handles; while (cur) @@ -2778,7 +3677,7 @@ lt_dlforeach (func, data) } } - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); return errors; } @@ -2786,18 +3685,16 @@ lt_dlforeach (func, data) lt_dlcaller_id lt_dlcaller_register () { - static int last_caller_id = -1; + static lt_dlcaller_id last_caller_id = 0; int result; - MUTEX_LOCK (); + LT_DLMUTEX_LOCK (); result = ++last_caller_id; - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); return result; } -#define N_ELEMENTS(a) (sizeof(a) / sizeof(*(a))) - lt_ptr lt_dlcaller_set_data (key, handle, data) lt_dlcaller_id key; @@ -2810,10 +3707,11 @@ lt_dlcaller_set_data (key, handle, data) /* This needs to be locked so that the caller data can be updated simultaneously by different threads. */ - MUTEX_LOCK (); + LT_DLMUTEX_LOCK (); if (handle->caller_data) - n_elements = N_ELEMENTS (handle->caller_data); + while (handle->caller_data[n_elements].key) + ++n_elements; for (i = 0; i < n_elements; ++i) { @@ -2825,31 +3723,29 @@ lt_dlcaller_set_data (key, handle, data) } /* Ensure that there is enough room in this handle's caller_data - array to accept a new element. */ + array to accept a new element (and an empty end marker). */ if (i == n_elements) { lt_caller_data *temp - = LT_DLREALLOC (lt_caller_data, handle->caller_data, 1+ n_elements); + = LT_DLREALLOC (lt_caller_data, handle->caller_data, 2+ n_elements); - if (temp == 0) + if (!temp) { - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); - stale = (lt_ptr) 0; + stale = 0; goto done; } - else - { - handle->caller_data = temp; - } + + handle->caller_data = temp; /* We only need this if we needed to allocate a new caller_data. */ handle->caller_data[i].key = key; + handle->caller_data[1+ i].key = 0; } handle->caller_data[i].data = data; done: - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); return stale; } @@ -2860,19 +3756,15 @@ lt_dlcaller_get_data (key, handle) lt_dlhandle handle; { lt_ptr result = (lt_ptr) 0; - int n_elements = 0; /* This needs to be locked so that the caller data isn't updated by another thread part way through this function. */ - MUTEX_LOCK (); - - if (handle->caller_data) - n_elements = N_ELEMENTS (handle->caller_data); + LT_DLMUTEX_LOCK (); /* Locate the index of the element with a matching KEY. */ { int i; - for (i = 0; i < n_elements; ++i) + for (i = 0; handle->caller_data[i].key; ++i) { if (handle->caller_data[i].key == key) { @@ -2882,7 +3774,7 @@ lt_dlcaller_get_data (key, handle) } } - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); return result; } @@ -2906,17 +3798,14 @@ lt_dlloader_add (place, dlloader, loader_name) || (dlloader->module_close == 0) || (dlloader->find_sym == 0)) { - MUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); return 1; } /* Create a new dlloader node with copies of the user callbacks. */ - node = LT_DLMALLOC (lt_dlloader, 1); - if (node == 0) - { - MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); - return 1; - } + node = LT_EMALLOC (lt_dlloader, 1); + if (!node) + return 1; node->next = 0; node->loader_name = loader_name; @@ -2927,7 +3816,7 @@ lt_dlloader_add (place, dlloader, loader_name) node->find_sym = dlloader->find_sym; node->dlloader_data = dlloader->dlloader_data; - MUTEX_LOCK (); + LT_DLMUTEX_LOCK (); if (!loaders) { /* If there are no loaders, NODE becomes the list! */ @@ -2960,7 +3849,7 @@ lt_dlloader_add (place, dlloader, loader_name) if (ptr->next != place) { - last_error = LT_DLSTRERROR (INVALID_LOADER); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); ++errors; } else @@ -2971,7 +3860,7 @@ lt_dlloader_add (place, dlloader, loader_name) } } - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); return errors; } @@ -2986,18 +3875,18 @@ lt_dlloader_remove (loader_name) if (!place) { - MUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); return 1; } - MUTEX_LOCK (); + LT_DLMUTEX_LOCK (); /* Fail if there are any open modules which use this loader. */ for (handle = handles; handle; handle = handle->next) { if (handle->loader == place) { - MUTEX_SETERROR (LT_DLSTRERROR (REMOVE_LOADER)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (REMOVE_LOADER)); ++errors; goto done; } @@ -3032,7 +3921,7 @@ lt_dlloader_remove (loader_name) LT_DLFREE (place); done: - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); return errors; } @@ -3043,9 +3932,9 @@ lt_dlloader_next (place) { lt_dlloader *next; - MUTEX_LOCK (); + LT_DLMUTEX_LOCK (); next = place ? place->next : loaders; - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); return next; } @@ -3058,13 +3947,13 @@ lt_dlloader_name (place) if (place) { - MUTEX_LOCK (); + LT_DLMUTEX_LOCK (); name = place ? place->loader_name : 0; - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); } else { - MUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); } return name; @@ -3078,13 +3967,13 @@ lt_dlloader_data (place) if (place) { - MUTEX_LOCK (); + LT_DLMUTEX_LOCK (); data = place ? &(place->dlloader_data) : 0; - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); } else { - MUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); } return data; @@ -3096,7 +3985,7 @@ lt_dlloader_find (loader_name) { lt_dlloader *place = 0; - MUTEX_LOCK (); + LT_DLMUTEX_LOCK (); for (place = loaders; place; place = place->next) { if (strcmp (place->loader_name, loader_name) == 0) @@ -3104,7 +3993,7 @@ lt_dlloader_find (loader_name) break; } } - MUTEX_UNLOCK (); + LT_DLMUTEX_UNLOCK (); return place; } diff --git a/libltdl/ltdl.h b/libltdl/ltdl.h index 28606c114..2bbfa302c 100644 --- a/libltdl/ltdl.h +++ b/libltdl/ltdl.h @@ -34,6 +34,9 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA /* --- MACROS FOR PORTABILITY --- */ +/* Saves on those hard to debug '\0' typos.... */ +#define LT_EOS_CHAR '\0' + /* LTDL_BEGIN_C_DECLS should be used at the beginning of your declarations, so that C++ compilers don't mangle their names. Use LTDL_END_C_DECLS at the end of C declarations. */ @@ -82,6 +85,8 @@ LT_BEGIN_C_DECLS # define LT_CONC(s,t) s/**/t #endif +/* LT_STRLEN can be used safely on NULL pointers. */ +#define LT_STRLEN(s) (((s) && (s)[0]) ? strlen (s) : 0) @@ -146,10 +151,16 @@ typedef struct lt_dlhandle_struct *lt_dlhandle; /* A loaded module. */ extern int lt_dlinit LT_PARAMS((void)); extern int lt_dlexit LT_PARAMS((void)); -/* Module search path manipultation. */ -extern int lt_dladdsearchdir LT_PARAMS((const char *search_dir)); -extern int lt_dlsetsearchpath LT_PARAMS((const char *search_path)); -extern const char *lt_dlgetsearchpath LT_PARAMS((void)); +/* Module search path manipulation. */ +extern int lt_dladdsearchdir LT_PARAMS((const char *search_dir)); +extern int lt_dlinsertsearchdir LT_PARAMS((const char *before, + const char *search_dir)); +extern int lt_dlsetsearchpath LT_PARAMS((const char *search_path)); +extern const char *lt_dlgetsearchpath LT_PARAMS((void)); +extern int lt_dlforeachfile LT_PARAMS(( + const char *search_path, + int (*func) (const char *filename, lt_ptr data), + lt_ptr data)); /* Portable libltdl versions of the system dlopen() API. */ extern lt_dlhandle lt_dlopen LT_PARAMS((const char *filename)); @@ -171,7 +182,7 @@ extern int lt_dlisresident LT_PARAMS((lt_dlhandle handle)); typedef void lt_dlmutex_lock LT_PARAMS((void)); typedef void lt_dlmutex_unlock LT_PARAMS((void)); -typedef void lt_dlmutex_seterror LT_PARAMS((const char *error)); +typedef void lt_dlmutex_seterror LT_PARAMS((const char *errmsg)); typedef const char *lt_dlmutex_geterror LT_PARAMS((void)); extern int lt_dlmutex_register LT_PARAMS((lt_dlmutex_lock *lock, @@ -185,8 +196,13 @@ extern int lt_dlmutex_register LT_PARAMS((lt_dlmutex_lock *lock, /* --- MEMORY HANDLING --- */ -/* Pointers to memory management functions to be used by libltdl. */ +/* By default, the realloc function pointer is set to our internal + realloc implementation which iself uses lt_dlmalloc and lt_dlfree. + libltdl relies on a featureful realloc, but if you are sure yours + has the right semantics then you can assign it directly. Generally, + it is safe to assign just a malloc() and a free() function. */ LT_SCOPE lt_ptr (*lt_dlmalloc) LT_PARAMS((size_t size)); +LT_SCOPE lt_ptr (*lt_dlrealloc) LT_PARAMS((lt_ptr ptr, size_t size)); LT_SCOPE void (*lt_dlfree) LT_PARAMS((lt_ptr ptr)); @@ -275,8 +291,8 @@ extern lt_dlloader *lt_dlloader_find LT_PARAMS(( extern const char *lt_dlloader_name LT_PARAMS((lt_dlloader *place)); extern lt_user_data *lt_dlloader_data LT_PARAMS((lt_dlloader *place)); extern int lt_dlloader_add LT_PARAMS((lt_dlloader *place, - const struct lt_user_dlloader *dlloader, - const char *loader_name)); + const struct lt_user_dlloader *dlloader, + const char *loader_name)); extern int lt_dlloader_remove LT_PARAMS(( const char *loader_name)); @@ -307,7 +323,8 @@ extern int lt_dlloader_remove LT_PARAMS(( LT_ERROR(INVALID_ERRORCODE, "invalid errorcode") \ LT_ERROR(SHUTDOWN, "library already shutdown") \ LT_ERROR(CLOSE_RESIDENT_MODULE, "can't close resident module") \ - LT_ERROR(INVALID_MUTEX_ARGS, "invalid mutex handler registration") + LT_ERROR(INVALID_MUTEX_ARGS, "invalid mutex handler registration") \ + LT_ERROR(INVALID_POSITION, "invalid search path insert position") /* Enumerate the symbolic error names. */ enum { diff --git a/libtool.m4 b/libtool.m4 index aa7e62a0e..497f70889 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -1,4 +1,4 @@ -## libtool.m4 - Configure libtool for the host system. -*-Shell-script-*- +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- ## Copyright 1996, 1997, 1998, 1999, 2000, 2001 ## Free Software Foundation, Inc. ## Originally by Gordon Matzigkeit , 1996 @@ -22,7 +22,10 @@ ## configuration script generated by Autoconf, you may include it under ## the same distribution terms that you use for the rest of that program. -# serial 46 AC_PROG_LIBTOOL +# serial 47 AC_PROG_LIBTOOL + +# AC_PROG_LIBTOOL +# --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX @@ -30,7 +33,7 @@ dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX -])]) + ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run @@ -38,55 +41,42 @@ dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [ifdef([AC_PROG_GCJ], - [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ -])]) - ifdef([A][M_PROG_GCJ], - [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ -])]) - ifdef([LT_AC_PROG_GCJ], - [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ -])])])])])]) + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +])])# AC_PROG_LIBTOOL + +# _AC_PROG_LIBTOOL +# ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl -# Save cache, so that ltconfig can load it -AC_CACHE_SAVE - -# Actually configure libtool. ac_aux_dir is where install-sh is found. -AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ -MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ -LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \ -AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \ -objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \ -deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \ -${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ -$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \ -|| AC_MSG_ERROR([libtool configure failed]) - -# Reload cache, that may have been modified by ltconfig -AC_CACHE_LOAD - # This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh" +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl -# Redirect the config.log output again, so that the ltconfig log is not -# clobbered by the next message. -exec 5>>./config.log -]) +# Prevent multiple expansion +define([AC_PROG_LIBTOOL], []) +])# _AC_PROG_LIBTOOL + +# AC_LIBTOOL_SETUP +# ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.13)dnl +[AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl @@ -96,6 +86,8 @@ AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl +AC_REQUIRE([LT_AC_PROG_SED])dnl + AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! @@ -103,6 +95,94 @@ AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl +AC_LIBTOOL_SYS_MAX_CMD_LEN +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +AC_LIBTOOL_OBJDIR + +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" + ;; + *) + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) @@ -112,34 +192,248 @@ file_magic*) ;; esac -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -# Check for any special flags to pass to ltconfig. -libtool_flags="--cache-file=$cache_file" -test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" -test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" -test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" -test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc" -test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" -ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], -[libtool_flags="$libtool_flags --enable-dlopen"]) +ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -[libtool_flags="$libtool_flags --enable-win32-dll"]) -AC_ARG_ENABLE(libtool-lock, - [ --disable-libtool-lock avoid locking (might break parallel builds)]) -test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" -test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" - -AC_ARG_WITH(pic, - [ --with-pic try to use only PIC/non-PIC objects [default=use both]], - pic_mode="$withval", pic_mode=default) -test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic" -test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +AC_ARG_WITH([pic], + [AC_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP + + +# _LT_AC_SYS_COMPILER +# ------------------- +AC_DEFUN([_LT_AC_SYS_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +set dummy $CC +compiler="[$]2" +])# _LT_AC_SYS_COMPILER + + +# _LT_AC_SYS_LIBPATH_AIX +# ---------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_AC_SYS_LIBPATH_AIX + + +# _LT_AC_PROG_ECHO_BACKSLASH +# -------------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +echo=${ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(ECHO) +AC_DIVERT_POP +])# _LT_AC_PROG_ECHO_BACKSLASH + + +# _LT_AC_LOCK +# ----------- +AC_DEFUN([_LT_AC_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext @@ -164,16 +458,14 @@ case $host in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_SAVE - AC_LANG_C + [AC_LANG_PUSH(C) AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_RESTORE]) + AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; - ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) @@ -205,637 +497,4799 @@ ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], ;; ]) esac -]) -# AC_LIBTOOL_DLOPEN - enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) +need_locks="$enable_libtool_lock" -# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's -AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) +])# _LT_AC_LOCK -# AC_ENABLE_SHARED - implement the --enable-shared flag -# Usage: AC_ENABLE_SHARED[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN([AC_ENABLE_SHARED], -[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(shared, -changequote(<<, >>)dnl -<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case $enableval in -yes) enable_shared=yes ;; -no) enable_shared=no ;; -*) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl + +# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +[AC_CACHE_CHECK([$1], [$2], + [$2=no + ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $3" + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + if (eval $ac_compile 2>conftest.err) && test -s $ac_outfile; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + else + $2=yes + fi + fi + $rm conftest* + CFLAGS="$save_CFLAGS" ]) -# AC_DISABLE_SHARED - set the default shared flag to --disable-shared -AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no)]) +if test x"[$]$2" = xyes; then + ifelse([$5], , :, [$5]) +else + ifelse([$6], , :, [$6]) +fi +])# AC_LIBTOOL_COMPILER_OPTION -# AC_ENABLE_STATIC - implement the --enable-static flag -# Usage: AC_ENABLE_STATIC[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN([AC_ENABLE_STATIC], -[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(static, -changequote(<<, >>)dnl -<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case $enableval in -yes) enable_static=yes ;; -no) enable_static=no ;; -*) - enable_static=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_static=AC_ENABLE_STATIC_DEFAULT)dnl + +# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ------------------------------------------------------------ +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +[AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + else + $2=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" ]) -# AC_DISABLE_STATIC - set the default static flag to --disable-static -AC_DEFUN([AC_DISABLE_STATIC], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no)]) +if test x"[$]$2" = xyes; then + ifelse([$4], , :, [$4]) +else + ifelse([$5], , :, [$5]) +fi +])# AC_LIBTOOL_LINKER_OPTION -# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag -# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN([AC_ENABLE_FAST_INSTALL], -[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(fast-install, -changequote(<<, >>)dnl -<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case $enableval in -yes) enable_fast_install=yes ;; -no) enable_fast_install=no ;; -*) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl +# AC_LIBTOOL_SYS_MAX_CMD_LEN +# -------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +[# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + testring="ABCD" + + case $host_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \ + = "XX$testring") >/dev/null 2>&1 && + new_result=`expr "X$testring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + testring=$testring$testring + done + testring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac ]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +])# AC_LIBTOOL_SYS_MAX_CMD_LEN -# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install -AC_DEFUN([AC_DISABLE_FAST_INSTALL], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no)]) -# AC_LIBTOOL_PICMODE - implement the --with-pic flag -# Usage: AC_LIBTOOL_PICMODE[(MODE)] -# Where MODE is either `yes' or `no'. If omitted, it defaults to -# `both'. -AC_DEFUN([AC_LIBTOOL_PICMODE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -pic_mode=ifelse($#,1,$1,default)]) +# _LT_AC_CHECK_DLFCN +# -------------------- +AC_DEFUN([_LT_AC_CHECK_DLFCN], +[AC_CHECK_HEADERS(dlfcn.h)dnl +])# _LT_AC_CHECK_DLFCN -# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in - /*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; - ?:/*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. - ;; - *) - ac_save_MAGIC_CMD="$MAGIC_CMD" - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="ifelse([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then - : - else - cat <&2 +# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ------------------------------------------------------------------ +AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +}] EOF - fi ;; - esac - fi - break - fi - done - IFS="$ac_save_ifs" - MAGIC_CMD="$ac_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_unknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_AC_TRY_DLOPEN_SELF + + +# AC_LIBTOOL_DLOPEN_SELF +# ------------------- +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown else - AC_MSG_RESULT(no) + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + cygwin* | mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac fi +])# AC_LIBTOOL_DLOPEN_SELF + + +# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +# --------------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler +AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + ifelse([$1],[],[save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"], + [$1],[CXX],[save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -o out/conftest2.$ac_objext"], + [$1],[GCJ],[save_GCJFLAGS="$GCJFLAGS" + GCJFLAGS="$GCJFLAGS -o out/conftest2.$ac_objext"]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + # According to Tom Tromey, Ian Lance Taylor reported there are C compilers + # that will create temporary files in the current directory regardless of + # the output directory. Thus, making CWD read-only will cause this test + # to fail, enabling locking or at least warning the user not to do parallel + # builds. + chmod -w . + + if (eval $ac_compile 2>out/conftest.err) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s out/conftest.err; then + # Append any errors to the config.log. + cat out/conftest.err 1>&AS_MESSAGE_LOG_FD + else + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + ifelse([$1],[],[CFLAGS="$save_CFLAGS"], + [$1],[CXX],[CXXFLAGS="$save_CXXFLAGS"], + [$1],[GCJ],[GCJFLAGS="$save_GCJFLAGS"]) + chmod u+w . + $rm conftest* out/* + rmdir out + cd .. + rmdir conftest + $rm conftest* ]) +])# AC_LIBTOOL_PROG_CC_C_O -# AC_PATH_MAGIC - find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl -AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH) +# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +# ----------------------------------------- +# Check to see if we can do hard links to lock some files if needed +AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +[AC_REQUIRE([_LT_AC_LOCK])dnl + +hard_links="nottested" +if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + + +# AC_LIBTOOL_OBJDIR +# ----------------- +AC_DEFUN([AC_LIBTOOL_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +])# AC_LIBTOOL_OBJDIR + + +# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +# ---------------------------------------------- +# Check hardcoding attributes. +AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_AC_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ + test -n "$_LT_AC_TAGVAR(runpath_var $1)"; then + + # We can hardcode non-existant directories. + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_AC_TAGVAR(hardcode_action, $1)=relink else - MAGIC_CMD=: + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi -]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) +if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH -# AC_PROG_LD - find the path to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], -[AC_ARG_WITH(gnu-ld, -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], -test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]* | [A-Za-z]:[\\/]*)] - re_direlt=['/[^/][^/]*/\.\./'] - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" -else - lt_cv_path_LD="$LD" # Let the user override the test with a path. -fi]) -LD="$lt_cv_path_LD" -if test -n "$LD"; then - AC_MSG_RESULT($LD) + +# AC_LIBTOOL_SYS_LIB_STRIP +# ------------------------ +AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +[striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_PROG_LD_GNU -]) +])# AC_LIBTOOL_SYS_LIB_STRIP -AC_DEFUN([AC_PROG_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then - lt_cv_prog_gnu_ld=yes -else - lt_cv_prog_gnu_ld=no -fi]) -with_gnu_ld=$lt_cv_prog_gnu_ld -]) -# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker -# -- PORTME Some linkers may need a different reload flag. -AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], -[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, -[lt_cv_ld_reload_flag='-r']) -reload_flag=$lt_cv_ld_reload_flag -test -n "$reload_flag" && reload_flag=" $reload_flag" -]) +# AC_LIBTOOL_SYS_DYNAMIC_LINKER +# ----------------------------- +# PORTME Fill in your ld.so characteristics +AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +[AC_MSG_CHECKING([dynamic linker characteristics]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +need_lib_prefix=unknown +hardcode_into_libs=no -# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies -# -- PORTME fill in with the dynamic library characteristics -AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], -[AC_CACHE_CHECK([how to recognise dependant libraries], -lt_cv_deplibs_check_method, -[lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# '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_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. +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown case $host_os in -aix*) - lt_cv_deplibs_check_method=pass_all +aix3*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}.so$major' ;; -beos*) - lt_cv_deplibs_check_method=pass_all +aix4* | aix5*) + version_type=linux + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}.so$major' + fi + shlibpath_var=LIBPATH + fi ;; -bsdi4*) - lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'] - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; -cygwin* | mingw* |pw32*) - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' +beos*) + library_names_spec='${libname}.so' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH ;; -darwin* | rhapsody*) - lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' - lt_cv_file_magic_cmd='/usr/bin/file -L' - case "$host_os" in - rhapsody* | darwin1.[012]) - lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System' +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + need_version=no + need_lib_prefix=no + case $GCC,$host_os in + yes,cygwin*) + library_names_spec='$libname.dll.a' + sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' + postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog .libs/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' ;; - *) # Darwin 1.3 on - lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' + yes,mingw*) + library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://"` + if echo "$sys_lib_search_path_spec" | [egrep ';[C-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | sed -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | sed -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + yes,pw32*) + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' + ;; + *) + library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib' ;; esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH ;; -freebsd* ) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method=['file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'] - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. + library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' + soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + need_version=no + need_lib_prefix=no ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi + freebsd-*) + library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac ;; gnu*) - lt_cv_deplibs_check_method=pass_all + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes ;; -hpux10.20*|hpux11*) - lt_cv_deplibs_check_method=['file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'] - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libc.sl +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + if test "$host_cpu" = ia64; then + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + else + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' + soname_spec='${libname}${release}.sl$major' + fi + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' ;; -irix5* | irix6*) +irix5* | irix6* | nonstopux*) case $host_os in - irix5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" + nonstopux*) version_type=nonstopux ;; + *) version_type=irix ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= ;; *) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; esac - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method=["file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"] ;; esac - lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` - lt_cv_deplibs_check_method=pass_all + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no ;; # This must be Linux ELF. -linux-gnu*) - case $host_cpu in - alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM - lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'] ;; - esac - lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' ;; netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'] + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' else - [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'] + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' + soname_spec='${libname}${release}.so$major' + dynamic_linker='NetBSD ld.elf_so' fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes ;; newsos6) - [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'] - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + need_lib_prefix=no + library_names_spec='$libname.dll $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' - lt_cv_file_magic_test_file=/shlib/libc.so - lt_cv_deplibs_check_method=pass_all + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}.so' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) - lt_cv_deplibs_check_method=pass_all + version_type=osf + soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + shlibpath_var=LD_LIBRARY_PATH ;; solaris*) - lt_cv_deplibs_check_method=pass_all - lt_cv_file_magic_test_file=/lib/libc.so + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' ;; -[sysv5uw[78]* | sysv4*uw2*)] - lt_cv_deplibs_check_method=pass_all +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH case $host_vendor in - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - motorola) - lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'] - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; + sni) + shlibpath_overrides_runpath=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; esac ;; -esac -]) -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -]) - - -# AC_PROG_NM - find the path to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_MSG_CHECKING([for BSD-compatible nm]) -AC_CACHE_VAL(lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/${ac_tool_prefix}nm - if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then - lt_cv_path_NM="$tmp_nm -B" - break - elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - lt_cv_path_NM="$tmp_nm -p" - break - else - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - fi - fi - done - IFS="$ac_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi]) -NM="$lt_cv_path_NM" -AC_MSG_RESULT([$NM]) -]) -# AC_CHECK_LIBM - check for math library -AC_DEFUN([AC_CHECK_LIBM], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32*) - # These system don't have libm +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' + soname_spec='$libname.so.$major' + shlibpath_var=LD_LIBRARY_PATH + fi ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") + +uts4*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH ;; + *) - AC_CHECK_LIB(m, main, LIBM="-lm") + dynamic_linker=no ;; esac -]) +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no +])# AC_LIBTOOL_SYS_DYNAMIC_LINKER -# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl convenience library and INCLTDL to the include flags for -# the libltdl header and adds --enable-ltdl-convenience to the -# configure arguments. Note that LIBLTDL and INCLTDL are not -# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not -# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed -# with '${top_builddir}/' and INCLTDL will be prefixed with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and -# top_srcdir appropriately in the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case $enable_ltdl_convenience in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la - INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) -]) -# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl installable library and INCLTDL to the include flags for -# the libltdl header and adds --enable-ltdl-install to the configure -# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is -# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed -# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will -# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed -# with '${top_srcdir}/' (note the single quotes!). If your package is -# not flat and you're not using automake, define top_builddir and -# top_srcdir appropriately in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +# _LT_AC_TAGCONFIG +# ---------------- +AC_DEFUN([_LT_AC_TAGCONFIG], +[AC_ARG_WITH([tags], + [AC_HELP_STRING([--with-tags=TAGS], + [include additional configurations @<:@CXX,GCJ@:>@])], + [tagnames="$withval"], + [tagnames="CXX,GCJ" + case $host_os in + mingw*|cygwin*) tagnames="$tagnames,RC" ;; + esac]) + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) + fi + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | sed -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in + "") ;; + *) AC_MSG_ERROR([invalid tag name: $tagname]) + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + AC_MSG_ERROR([tag name \"$tagname\" already exists]) + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + AC_LIBTOOL_LANG_CXX_CONFIG + ;; + + GCJ) + AC_LIBTOOL_LANG_GCJ_CONFIG + ;; + + RC) + AC_LIBTOOL_LANG_RC_CONFIG + ;; + + *) + AC_MSG_ERROR([Unsupported tag name: $tagname]) + ;; + esac + + # Append the new tag name to the list of available tags. + available_tags="$available_tags $tagname" + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + fi +fi +])# _LT_AC_TAGCONFIG + + +# AC_LIBTOOL_DLOPEN +# ----------------- +# enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_DLOPEN + + +# AC_LIBTOOL_WIN32_DLL +# -------------------- +# declare package support for building win32 dll's +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_WIN32_DLL + + +# AC_ENABLE_SHARED([DEFAULT]) +# --------------------------- +# implement the --enable-shared flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_SHARED], +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([shared], + [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +])# AC_ENABLE_SHARED + + +# AC_DISABLE_SHARED +# ----------------- +#- set the default shared flag to --disable-shared +AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, main, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la - INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) +AC_ENABLE_SHARED(no) +])# AC_DISABLE_SHARED + + +# AC_ENABLE_STATIC([DEFAULT]) +# --------------------------- +# implement the --enable-static flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_STATIC], +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([static], + [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]AC_ENABLE_STATIC_DEFAULT) +])# AC_ENABLE_STATIC + + +# AC_DISABLE_STATIC +# ----------------- +# set the default static flag to --disable-static +AC_DEFUN([AC_DISABLE_STATIC], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no) +])# AC_DISABLE_STATIC + + +# AC_ENABLE_FAST_INSTALL([DEFAULT]) +# --------------------------------- +# implement the --enable-fast-install flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_FAST_INSTALL], +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([fast-install], + [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +])# AC_ENABLE_FAST_INSTALL + + +# AC_DISABLE_FAST_INSTALL +# ----------------------- +# set the default to --disable-fast-install +AC_DEFUN([AC_DISABLE_FAST_INSTALL], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no) +])# AC_DISABLE_FAST_INSTALL + + +# AC_LIBTOOL_PICMODE([MODE]) +# -------------------------- +# implement the --with-pic flag +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +AC_DEFUN([AC_LIBTOOL_PICMODE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +pic_mode=ifelse($#,1,$1,default) +])# AC_LIBTOOL_PICMODE + + +# AC_PATH_TOOL_PREFIX +# ------------------- +# find a file program which can recognise shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + egrep "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +])# AC_PATH_TOOL_PREFIX + + +# AC_PATH_MAGIC +# ------------- +# find a file program which can recognise a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# AC_PATH_MAGIC + + +# AC_PROG_LD +# ---------- +# find the path to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH([gnu-ld], + [AC_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no]) +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by GCC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$lt_save_ifs" +else + lt_cv_path_LD="$LD" # Let the user override the test with a path. +fi]) +LD="$lt_cv_path_LD" +if test -n "$LD"; then + AC_MSG_RESULT($LD) +else + AC_MSG_RESULT(no) +fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +AC_PROG_LD_GNU +])# AC_PROG_LD + + +# AC_PROG_LD_GNU +# -------------- +AC_DEFUN([AC_PROG_LD_GNU], +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, +[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 &5; then + lt_cv_prog_gnu_ld=yes +else + lt_cv_prog_gnu_ld=no +fi]) +with_gnu_ld=$lt_cv_prog_gnu_ld +])# AC_PROG_LD_GNU + + +# AC_PROG_LD_RELOAD_FLAG +# ---------------------- +# find reload flag for linker +# -- PORTME Some linkers may need a different reload flag. +AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], +[AC_CACHE_CHECK([for $LD option to reload object files], + lt_cv_ld_reload_flag, + [lt_cv_ld_reload_flag='-r']) +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +])# AC_PROG_LD_RELOAD_FLAG + + +# AC_DEPLIBS_CHECK_METHOD +# ----------------------- +# how to check for library dependencies +# -- PORTME fill in with the dynamic library characteristics +AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], +[AC_CACHE_CHECK([how to recognise dependant libraries], +lt_cv_deplibs_check_method, +[lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# '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_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. + +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi4*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin* | mingw* | pw32*) + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' + lt_cv_file_magic_cmd='/usr/bin/file -L' + case "$host_os" in + rhapsody* | darwin1.[[012]]) + lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System` + ;; + *) # Darwin 1.3 on + lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' + ;; + esac + ;; + +freebsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + if test "$host_cpu" = ia64; then + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + else + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + fi + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + irix5* | nonstopux*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" + ;; + *) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1" + ;; + esac + lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + case $host_cpu in + alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh*) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; + esac + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' + else + lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' + fi + ;; + +osf3* | osf4* | osf5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' + lt_cv_file_magic_test_file=/shlib/libc.so + lt_cv_deplibs_check_method=pass_all + ;; + +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=/lib/libc.so + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + esac + ;; + +sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown +])# AC_DEPLIBS_CHECK_METHOD + + +# AC_PROG_NM +# ---------- +# find the path to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/${ac_tool_prefix}nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + if ("$tmp_nm" -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then + lt_cv_path_NM="$tmp_nm -B" + break + elif ("$tmp_nm" -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + lt_cv_path_NM="$tmp_nm -p" + break + else + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + fi + fi + done + IFS="$lt_save_ifs" + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +])# AC_PROG_NM + + +# AC_CHECK_LIBM +# ------------- +# check for math library +AC_DEFUN([AC_CHECK_LIBM], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32*) + # These system don't have libm + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, main, LIBM="-lm") + ;; +esac +])# AC_CHECK_LIBM + + +# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl convenience library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL +# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If +# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will +# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and +# top_srcdir appropriately in the Makefiles. +AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_CONVENIENCE + + +# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl installable library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-install to the configure arguments. Note that LIBLTDL +# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If +# DIRECTORY is not provided and an installed libltdl is not found, it is +# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' +# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single +# quotes!). If your package is not flat and you're not using automake, +# define top_builddir and top_srcdir appropriately in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, main, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= + fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_INSTALLABLE + + +# If this macro is not defined by Autoconf, define it here. +ifdef([AC_PROVIDE_IFELSE], + [], + [define([AC_PROVIDE_IFELSE], + [ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AC_LIBTOOL_CXX +# -------------- +# enable support for C++ libraries +AC_DEFUN([AC_LIBTOOL_CXX], +[AC_REQUIRE([_LT_AC_LANG_CXX]) +])# AC_LIBTOOL_CXX + + +# _LT_AC_LANG_CXX +# --------------- +AC_DEFUN([_LT_AC_LANG_CXX], +[AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([AC_PROG_CXXCPP]) +])# _LT_AC_LANG_CXX + + +# AC_LIBTOOL_GCJ +# -------------- +# enable support for GCJ libraries +AC_DEFUN([AC_LIBTOOL_GCJ], +[AC_REQUIRE([_LT_AC_LANG_GCJ]) +])# AC_LIBTOOL_GCJ + + +# _LT_AC_LANG_GCJ +# --------------- +AC_DEFUN([_LT_AC_LANG_GCJ], +[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], + [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], + [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], + [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +])# _LT_AC_LANG_GCJ + + +# AC_LIBTOOL_RC +# -------------- +# enable support for Windows resource files +AC_DEFUN([AC_LIBTOOL_RC], +[AC_REQUIRE([AC_PROG_RC]) +])# AC_LIBTOOL_RC + + +# AC_LIBTOOL_LANG_C_CONFIG +# ------------------------ +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +AC_DEFUN([_LT_AC_LANG_C_CONFIG], +[lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='main(){return(0);}' + +_LT_AC_SYS_COMPILER + +# +# Check for any special shared library compilation flags. +# +_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= +if test "$GCC" = no; then + case $host_os in + sco3.2v5*) + _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' + ;; + esac +fi +if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then + AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) + if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ ]]" >/dev/null; then : + else + AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) + _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no + fi +fi + + +# +# Check to make sure the static flag actually works. +# +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), + $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_DLOPEN_SELF($1) + +# Report which librarie types wil actually be built +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case "$host_os" in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +AC_MSG_RESULT([$enable_shared]) + +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_C_CONFIG + + +# AC_LIBTOOL_LANG_CXX_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +[AC_LANG_PUSH(C++) +AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([AC_PROG_CXXCPP]) + +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_AC_TAGVAR(allow_undefined_flag, $1)= +_LT_AC_TAGVAR(always_export_symbols, $1)=no +_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_direct, $1)=no +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_AC_TAGVAR(no_undefined_flag, $1)= +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + +# Dependencies to place before and after the object being linked: +_LT_AC_TAGVAR(predep_objects, $1)= +_LT_AC_TAGVAR(postdep_objects, $1)= +_LT_AC_TAGVAR(predeps, $1)= +_LT_AC_TAGVAR(postdeps, $1)= +_LT_AC_TAGVAR(compiler_lib_search_path, $1)= + +# Source file extension for C test sources. +ac_ext=cc + +# Object file extension for compiled C test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int char *[]) { return(0); }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${CXX-"c++"} +set dummy $CC +compiler="[$]2" +_LT_AC_TAGVAR(compiler, $1)=$CC +cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +else + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +fi + +if test "$GXX" = yes; then + # 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 + + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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 + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + 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. + _LT_AC_TAGVAR(archive_cmds, $1)='$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_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +_LT_AC_TAGVAR(ld_shlibs, $1)=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds it's shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + freebsd-elf*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + freebsd*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + ;; + gnu*) + ;; + hpux*) + if test $with_gnu_ld = no; then + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + else + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + fi + fi + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + else + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + fi + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC) + case $host_os in + hpux9*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + ;; + *) + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + fi + ;; + esac + # 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_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_os in + hpux9*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + ;; + *) + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + fi + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + irix5* | irix6*) + case $cc_basename in + CC) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $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' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib' + fi + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + linux*) + case $cc_basename in + KCC) + # 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. + _LT_AC_TAGVAR(archive_cmds, $1)='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_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_cmd='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' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + cxx) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # 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_cmd='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' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + m88k*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + mvs*) + case $cc_basename in + cxx) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + netbsd*) + # NetBSD uses g++ - do we need to do anything? + ;; + osf3*) + case $cc_basename in + KCC) + # 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. + _LT_AC_TAGVAR(archive_cmds, $1)='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # 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_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "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' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$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' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # 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_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC) + # 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. + _LT_AC_TAGVAR(archive_cmds, $1)='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ + $rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # 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_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "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' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$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' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # 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_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + sco*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + lcc) + # Lucid + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + # 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_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep "\-R|\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | egrep -v '^2\.7' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp' + + # 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_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp' + + # 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_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\"" + fi + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; +esac +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +# Figure out "hidden" C++ library dependencies from verbose +# compiler output whening linking a shared library. +cat > conftest.$ac_ext <> "$cfgfile" +ifelse([$1], [], +[#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="sed -e s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG], +[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) + +# Is the compiler the GNU C compiler? +with_gcc=$_LT_AC_TAGVAR(GCC, $1) + +# The linker used to build libraries. +LD=$lt_[]_LT_AC_TAGVAR(LD, $1) + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A sed program that does not truncate output. +SED=$lt_SED + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) + +# Commands used to build and install a shared archive. +archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) + +# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" + +# Set to yes if exported symbols are required. +always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) + +# The commands to list exported symbols. +export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) + +# Symbols that must always be exported. +include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) + +ifelse([$1],[], +[# ### END LIBTOOL CONFIG], +[# ### END LIBTOOL TAG CONFIG: $tagname]) + +__EOF__ + +ifelse([$1],[], [ + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + + cygwin* | mingw* | pw32* | os2*) + cat <<'EOF' >> "$cfgfile" + # This is a source program that is used to create dlls on Windows + # Don't remove nor modify the starting and closing comments + _LT_AC_FILE_LTDLL_C + # This is a source program that is used to create import libraries + # on Windows for dlls which lack them. Don't remove nor modify the + # starting and closing comments + _LT_AC_FILE_IMPGEN_C +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +]) +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + test -f Makefile && make "$ltmain" +fi +])# AC_LIBTOOL_CONFIG + + +# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + +_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions -c conftest.$ac_ext], [], + [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI + + +# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +# --------------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_NM]) +AC_REQUIRE([AC_OBJEXT]) +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Transform the above into a raw symbol and a C symbol. +symxfrm='\1 \2\3 \3' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +solaris* | sysv5*) + symcode='[[BDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $host_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then + symcode='[[ABCDGISTW]]' +fi + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if egrep ' nm_test_var$' "$nlist" >/dev/null; then + if egrep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[[]] = +{ +EOF + sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + + +# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +# --------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) + ifelse([$1],[CXX],[ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + cygwin* | mingw* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX, but not for PA HP-UX. + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + fi + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + *) + ;; + esac + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC) + # KAI C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + cxx) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC) + # Rational C++ 2.4.1 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx) + # Digital/Compaq C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + sco*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + *) + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc) + # Lucid + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + unixware*) + ;; + vxworks*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + cygwin* | mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX, but not for PA HP-UX. + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + fi + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - INCLTDL= + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + cygwin* | mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + newsos6) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + osf3* | osf4* | osf5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + sco3.2v5*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' + ;; + + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sunos4*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + if test "x$host_vendor" = xsni; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-LD' + else + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + fi + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + uts4*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac fi ]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) -# If this macro is not defined by Autoconf, define it here. -ifdef([AC_PROVIDE_IFELSE], - [], - [define([AC_PROVIDE_IFELSE], - [ifdef([AC_PROVIDE_$1], - [$2], [$3])])]) +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then + AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), + [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -DPIC], [], + [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -DPIC" + ;; +esac +]) -# AC_LIBTOOL_CXX - enable support for C++ libraries -AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_AC_LIBTOOL_CXX])]) -AC_DEFUN([_AC_LIBTOOL_CXX], -[AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([AC_PROG_CXXCPP]) -LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh" -lt_save_CC="$CC" -lt_save_CFLAGS="$CFLAGS" -dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC -dnl is set to the C++ compiler. -AR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \ -MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ -LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \ -AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \ -objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \ -deplibs_check_method="$deplibs_check_method" \ -file_magic_cmd="$file_magic_cmd" \ -${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \ ---build="$build" --add-tag=CXX $ac_aux_dir/ltcf-cxx.sh $host \ -|| AC_MSG_ERROR([libtool tag configuration failed]) -CC="$lt_save_CC" -CFLAGS="$lt_save_CFLAGS" +# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +# ------------------------------------ +# See if the linker supports building shared libraries. +AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +ifelse([$1],[CXX],[ + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | egrep '(GNU)' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + ;; + cygwin* | mingw* | pw32*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + *) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +],[ + runpath_var= + _LT_AC_TAGVAR(allow_undefined_flag, $1)= -# Redirect the config.log output again, so that the ltconfig log is not -# clobbered by the next message. -exec 5>>./config.log -]) + _LT_AC_TAGVAR(archive_cmds, $1)= + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)= + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_AC_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an egrep regular expression of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac -# AC_LIBTOOL_GCJ - enable support for GCJ libraries -AC_DEFUN([AC_LIBTOOL_GCJ],[AC_REQUIRE([_AC_LIBTOOL_GCJ])]) + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' -AC_DEFUN([_AC_LIBTOOL_GCJ], -[AC_REQUIRE([AC_PROG_LIBTOOL]) -AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], - [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], - [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], - [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) -LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-gcj.sh" -lt_save_CC="$CC" -lt_save_CFLAGS="$CFLAGS" -dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC -dnl is set to the C++ compiler. -AR="$AR" LTCC="$CC" CC="$GCJ" CFLAGS="$GCJFLAGS" CPPFLAGS="$CPPFLAGS" \ -MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ -LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \ -AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \ -objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \ -deplibs_check_method="$deplibs_check_method" \ -file_magic_cmd="$file_magic_cmd" \ -${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \ ---build="$build" --add-tag=GCJ $ac_aux_dir/ltcf-gcj.sh $host \ -|| AC_MSG_ERROR([libtool tag configuration failed]) -CC="$lt_save_CC" -CFLAGS="$lt_save_CFLAGS" + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + beos*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, as there is + # no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + + extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ + sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ + test -f $output_objdir/impgen.exe || (cd $output_objdir && \ + if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ + else $CC -o impgen impgen.c ; fi)~ + $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' + + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' + + # cygwin and mingw dlls have different entry points and sets of symbols + # to exclude. + # FIXME: what about values for MSVC? + dll_entry=__cygwin_dll_entry@12 + dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ + case $host_os in + mingw*) + # mingw values + dll_entry=_DllMainCRTStartup@12 + dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ + ;; + esac + + # mingw and cygwin differ, and it's simplest to just exclude the union + # of the two symbol sets. + dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 + + # recent cygwin and mingw systems supply a stub DllMain which the user + # can override, but on older systems we have to supply one (in ltdll.c) + if test "x$lt_cv_need_dllmain" = "xyes"; then + ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " + ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~ + test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' + else + ltdll_obj= + ltdll_cmds= + fi + + # Extract the symbol export list from an `--export-all' def file, + # then regenerate the def file from the symbol export list, so that + # the compiled dll only exports the symbol export list. + # Be careful not to strip the DATA tag left by newer dlltools. + _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"' + $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ + sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' + + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is. + # If DATA tags from a recent dlltool are present, honour them! + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`head -1 $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname-def; + else + echo EXPORTS > $output_objdir/$soname-def; + _lt_hint=1; + cat $export_symbols | while read symbol; do + set dummy \$symbol; + case \[$]# in + 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; + *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; + esac; + _lt_hint=`expr 1 + \$_lt_hint`; + done; + fi~ + '"$ltdll_cmds"' + $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ + $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ + $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sunos4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + case $host_os in + cygwin* | mingw* | pw32*) + # dlltool doesn't understand --whole-archive et. al. + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + ;; + *) + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + ;; + esac + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | egrep '(GNU)' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac -# Redirect the config.log output again, so that the ltconfig log is not -# clobbered by the next message. -exec 5>>./config.log + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds it's shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + # see comment about different semantics on the GNU ld section + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + bsdi4*) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # FIXME: Setting linknames here is a bad hack. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + ;; + + darwin* | rhapsody*) + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' + ;; + *) # Darwin 1.3 on + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + ;; + esac + + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. Also zsh mangles + # `"' quotes if we put them in here... so don't! + _LT_AC_TAGVAR(archive_cmds, $1)='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring' + # We need to add '_' to the symbols in $export_symbols first + #_LT_AC_TAGVAR(archive_expsym_cmds, $1)="$_LT_AC_TAGVAR(archive_cmds, $1)"' && strip -s $export_symbols' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + ;; + + dgux*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9* | hpux10* | hpux11*) + if test "$GCC" = yes; then + case $host_os in + hpux9*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + ;; + *) + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + esac + else + case $host_os in + hpux9*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + ;; + *) + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + ;; + esac + fi + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + else + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + fi + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + sco3.2v5*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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 $linker_flags~$rm $lib.exp' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + if test "x$host_vendor" = xsni; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + fi + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4.2uw2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv5*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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 $linker_flags~$rm $lib.exp' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi ]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes +if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_AC_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $rm conftest* + echo 'static int dummy;' > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac +fi +])# AC_LIBTOOL_PROG_LD_SHLIBS + + +# _LT_AC_FILE_LTDLL_C +# ------------------- +# Be careful that the start marker always follows a newline. +AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ +])# _LT_AC_FILE_LTDLL_C -dnl old names + +# _LT_AC_FILE_IMPGEN_C +# -------------------- +# Be careful that the start marker always follows a newline. +AC_DEFUN([_LT_AC_FILE_IMPGEN_C], [ +# /* impgen.c starts here */ +# /* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. +# +# This file is part of GNU libtool. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# */ +# +# #include /* for printf() */ +# #include /* for open(), lseek(), read() */ +# #include /* for O_RDONLY, O_BINARY */ +# #include /* for strdup() */ +# +# /* O_BINARY isn't required (or even defined sometimes) under Unix */ +# #ifndef O_BINARY +# #define O_BINARY 0 +# #endif +# +# static unsigned int +# pe_get16 (fd, offset) +# int fd; +# int offset; +# { +# unsigned char b[2]; +# lseek (fd, offset, SEEK_SET); +# read (fd, b, 2); +# return b[0] + (b[1]<<8); +# } +# +# static unsigned int +# pe_get32 (fd, offset) +# int fd; +# int offset; +# { +# unsigned char b[4]; +# lseek (fd, offset, SEEK_SET); +# read (fd, b, 4); +# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); +# } +# +# static unsigned int +# pe_as32 (ptr) +# void *ptr; +# { +# unsigned char *b = ptr; +# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); +# } +# +# int +# main (argc, argv) +# int argc; +# char *argv[]; +# { +# int dll; +# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; +# unsigned long export_rva, export_size, nsections, secptr, expptr; +# unsigned long name_rvas, nexp; +# unsigned char *expdata, *erva; +# char *filename, *dll_name; +# +# filename = argv[1]; +# +# dll = open(filename, O_RDONLY|O_BINARY); +# if (dll < 1) +# return 1; +# +# dll_name = filename; +# +# for (i=0; filename[i]; i++) +# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') +# dll_name = filename + i +1; +# +# pe_header_offset = pe_get32 (dll, 0x3c); +# opthdr_ofs = pe_header_offset + 4 + 20; +# num_entries = pe_get32 (dll, opthdr_ofs + 92); +# +# if (num_entries < 1) /* no exports */ +# return 1; +# +# export_rva = pe_get32 (dll, opthdr_ofs + 96); +# export_size = pe_get32 (dll, opthdr_ofs + 100); +# nsections = pe_get16 (dll, pe_header_offset + 4 +2); +# secptr = (pe_header_offset + 4 + 20 + +# pe_get16 (dll, pe_header_offset + 4 + 16)); +# +# expptr = 0; +# for (i = 0; i < nsections; i++) +# { +# char sname[8]; +# unsigned long secptr1 = secptr + 40 * i; +# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); +# unsigned long vsize = pe_get32 (dll, secptr1 + 16); +# unsigned long fptr = pe_get32 (dll, secptr1 + 20); +# lseek(dll, secptr1, SEEK_SET); +# read(dll, sname, 8); +# if (vaddr <= export_rva && vaddr+vsize > export_rva) +# { +# expptr = fptr + (export_rva - vaddr); +# if (export_rva + export_size > vaddr + vsize) +# export_size = vsize - (export_rva - vaddr); +# break; +# } +# } +# +# expdata = (unsigned char*)malloc(export_size); +# lseek (dll, expptr, SEEK_SET); +# read (dll, expdata, export_size); +# erva = expdata - export_rva; +# +# nexp = pe_as32 (expdata+24); +# name_rvas = pe_as32 (expdata+32); +# +# printf ("EXPORTS\n"); +# for (i = 0; i/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=$TMPDIR/sed$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + { (exit 1); exit 1; } +} + _max=0 + _count=0 + # Add /usr/xpg4/bin/sed as it is typically found on Solaris + # along with /bin/sed that truncates output. + for _sed in $_sed_list /usr/xpg4/bin/sed; do + test ! -f ${_sed} && break + cat /dev/null > "$tmp/sed.in" + _count=0 + echo $ECHO_N "0123456789$ECHO_C" >"$tmp/sed.in" + # Check for GNU sed and select it if it is found. + if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then + lt_cv_path_SED=${_sed} + break; + fi + while true; do + cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp" + mv "$tmp/sed.tmp" "$tmp/sed.in" + cp "$tmp/sed.in" "$tmp/sed.nl" + echo >>"$tmp/sed.nl" + ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break + cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break + # 10000 chars as input seems more than enough + test $_count -gt 10 && break + _count=`expr $_count + 1` + if test $_count -gt $_max; then + _max=$_count + lt_cv_path_SED=$_sed + fi + done + done + rm -rf "$tmp" +]) +AC_MSG_RESULT([$SED]) +]) diff --git a/libtoolize.in b/libtoolize.in index 18fa0937a..f2beeea74 100644 --- a/libtoolize.in +++ b/libtoolize.in @@ -1,7 +1,7 @@ #! /bin/sh # libtoolize - Prepare a package to use libtool. # @configure_input@ -# Copyright (C) 1996-2000 Free Software Foundation, Inc. +# Copyright (C) 1996-2000, 2001 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify @@ -83,6 +83,10 @@ EOF --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION" + echo + echo "Copyright 1996-2000, 2001 Free Software Foundation, Inc." + echo "This is free software; see the source for copying conditions. There is NO" + echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit 0 ;; @@ -151,17 +155,7 @@ if test -z "$files"; then echo "$progname: cannot list files in \`$pkgdatadir'" 1>&2 exit 1 fi -files='config.guess config.sub ltconfig ltmain.sh ltcf-c.sh' - -#Add C++ support if $configure_ac uses AC_LIBTOOL_CXX or AC_PROG_CXX. -if egrep '^[ ]*AC_(PROG|LIBTOOL)_CXX' $configure_ac > /dev/null 2>&1; then - files="$files ltcf-cxx.sh" -fi - -#Add GCJ support if $configure_ac uses AC_LIBTOOL_GCJ or A[CM]_PROG_GCJ. -if egrep '^[ ]*A([CM]_PROG|C_LIBTOOL)_GCJ' $configure_ac > /dev/null 2>&1; then - files="$files ltcf-gcj.sh" -fi +files='config.guess config.sub ltmain.sh' auxdir=. auxdirline=`egrep '^AC_CONFIG_AUX_DIR' $configure_ac 2>/dev/null` @@ -214,7 +208,7 @@ if test -z "$automake"; then updatemsg="add the contents of \`$libtool_m4' to \`aclocal.m4'" fi - if egrep '^AC_DEFUN\(A[MC]_PROG_LIBTOOL' aclocal.m4 >/dev/null 2>&1; then + if egrep '^AC_DEFUN\(\[A[MC]_PROG_LIBTOOL' aclocal.m4 >/dev/null 2>&1; then # Check the version number on libtool.m4 and the one used in aclocal.m4. instserial=`grep '^# serial ' $libtool_m4 | grep 'A[MC]_PROG_LIBTOOL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'` diff --git a/lineno b/lineno deleted file mode 100755 index e4264f895..000000000 --- a/lineno +++ /dev/null @@ -1,98 +0,0 @@ -#! /bin/sh -# lineno - Replace instances of @LINENO@ with the file's current line number -# Gordon Matzigkeit , 1997 - -# Copyright (C) 1992-1999 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program 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 General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -AWK=${AWK-awk} -delete=no -files= -progname=`echo "$0" | sed 's%^.*/%%'` - -for arg -do - case "$arg" in - --delete) delete=yes ;; - - --help) - cat <&2 - exit 1 - ;; - - *) files="$files $arg" ;; - esac -done - -if test -z "$files"; then - echo "$progname: no FILES specified" 1>&2 - exit 1 -fi - -# Manage a temp file. -tmpfile="$progname.$$" -trap "rm -f $tmpfile; exit 1" 1 2 15 - -status=0 -for file in $files; do - if test -f "$file"; then : - else - status=1 - echo "$progname: \`$file' is not a file" 1>&2 - fi - - # Skip empty files. - test -s "$file" || continue - - # Transliterated from a section in autoconf (Autoconf 2.12). - $AWK ' - /@LINENO@/ { printf "%d:", NR } - { print } -' $file | sed '/@LINENO@/s/^\([0-9][0-9]*\):\(.*\)@LINENO@/\2\1/' > $tmpfile - - if test -s "$tmpfile"; then - cp $tmpfile $file && continue - fi - - if test "$delete" = yes; then - echo "$progname: deleting \`$file'" 1>&2 - rm -f $file - fi -done - -rm -f $tmpfile -exit $status diff --git a/ltdl.m4 b/ltdl.m4 index 3030bc81b..d24745fbd 100644 --- a/ltdl.m4 +++ b/ltdl.m4 @@ -1,5 +1,5 @@ -## ltdl.m4 - Configure ltdl for the target system. -*-Shell-script-*- -## Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. +## ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*- +## Copyright (C) 1999-2000 Free Software Foundation, Inc. ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -20,468 +20,405 @@ ## configuration script generated by Autoconf, you may include it under ## the same distribution terms that you use for the rest of that program. -# serial 1 AC_LIB_LTDL - -AC_DEFUN(AC_LIB_LTDL, -[AC_PREREQ(2.13)dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_C_CONST])dnl - -dnl AC_LIB_LTDL must perform all the checks necessary for compilation -dnl of the ltdl objects -- including compiler checks (above) and header -dnl checks (below). -AC_REQUIRE([AC_HEADER_STDC])dnl - -AC_CHECK_HEADERS(malloc.h memory.h stdlib.h stdio.h ctype.h dlfcn.h dl.h sys/dl.h dld.h) -AC_CHECK_HEADERS(string.h strings.h, break) -AC_CHECK_FUNCS(strchr index, break) -AC_CHECK_FUNCS(strrchr rindex, break) -AC_CHECK_FUNCS(memcpy bcopy, break) -AC_CHECK_FUNCS(strcmp) - -AC_REQUIRE([AC_LTDL_ENABLE_INSTALL])dnl -AC_REQUIRE([AC_LTDL_SHLIBEXT])dnl -AC_REQUIRE([AC_LTDL_SHLIBPATH])dnl -AC_REQUIRE([AC_LTDL_SYSSEARCHPATH])dnl -AC_REQUIRE([AC_LTDL_OBJDIR])dnl -AC_REQUIRE([AC_LTDL_DLPREOPEN])dnl -AC_REQUIRE([AC_LTDL_DLLIB])dnl -AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])dnl -AC_REQUIRE([AC_LTDL_DLSYM_USCORE])dnl -AC_REQUIRE([AC_LTDL_SYS_DLOPEN_DEPLIBS])dnl -]) +# serial 6 AC_LIB_LTDL + +# AC_WITH_LTDL +# ------------ +# Clients of libltdl can use this macro to allow the installer to +# choose between a shipped copy of the ltdl sources or a preinstalled +# version of the library. +AC_DEFUN([AC_WITH_LTDL], +[AC_REQUIRE([AC_LIB_LTDL]) +AC_SUBST([LIBLTDL]) +AC_SUBST([INCLTDL]) + +# Unless the user asks us to check, assume no installed ltdl exists. +use_installed_libltdl=no + +AC_ARG_WITH([included_ltdl], + [ --with-included-ltdl use the GNU ltdl sources included here]) + +if test "x$with_included_ltdl" != xyes; then + # We are not being forced to use the included libltdl sources, so + # decide whether there is a useful installed version we can use. + AC_CHECK_HEADER([ltdl.h], + [AC_CHECK_LIB([ltdl], [lt_dlcaller_register], + [with_included_ltdl=no], + [with_included_ltdl=yes]) + ]) +fi + +if test "x$enable_ltdl_install" != xyes; then + # If the user did not specify an installable libltdl, then default + # to a convenience lib. + AC_LIBLTDL_CONVENIENCE +fi + +if test "x$with_included_ltdl" = xno; then + # If the included ltdl is not to be used. then Use the + # preinstalled libltdl we found. + AC_DEFINE([HAVE_LTDL], 1, + [Define this if a modern libltdl is already installed]) + LIBLTDL=-lltdl +fi -AC_DEFUN(AC_LTDL_ENABLE_INSTALL, -[AC_ARG_ENABLE(ltdl-install, -[ --enable-ltdl-install install libltdl]) +# Report our decision... +AC_MSG_CHECKING([whether to use included libltdl]) +AC_MSG_RESULT([$with_included_ltdl]) + +AC_CONFIG_SUBDIRS([libltdl]) +])# AC_WITH_LTDL + + +# AC_LIB_LTDL +# ----------- +# Perform all the checks necessary for compilation of the ltdl objects +# -- including compiler checks and header checks. +AC_DEFUN([AC_LIB_LTDL], +[AC_PREREQ(2.50) +AC_REQUIRE([AC_PROG_CC]) +AC_REQUIRE([AC_C_CONST]) +AC_REQUIRE([AC_HEADER_STDC]) +AC_REQUIRE([AC_HEADER_DIRENT]) +AC_REQUIRE([_LT_AC_CHECK_DLFCN]) +AC_REQUIRE([AC_LTDL_ENABLE_INSTALL]) +AC_REQUIRE([AC_LTDL_SHLIBEXT]) +AC_REQUIRE([AC_LTDL_SHLIBPATH]) +AC_REQUIRE([AC_LTDL_SYSSEARCHPATH]) +AC_REQUIRE([AC_LTDL_OBJDIR]) +AC_REQUIRE([AC_LTDL_DLPREOPEN]) +AC_REQUIRE([AC_LTDL_DLLIB]) +AC_REQUIRE([AC_LTDL_SYMBOL_USCORE]) +AC_REQUIRE([AC_LTDL_DLSYM_USCORE]) +AC_REQUIRE([AC_LTDL_SYS_DLOPEN_DEPLIBS]) +AC_REQUIRE([AC_LTDL_FUNC_ARGZ]) + +AC_CHECK_HEADERS([assert.h ctype.h errno.h malloc.h memory.h stdlib.h \ + stdio.h unistd.h]) +AC_CHECK_HEADERS([dl.h sys/dl.h dld.h]) +AC_CHECK_HEADERS([string.h strings.h], [break]) + +AC_CHECK_FUNCS([strchr index], [break]) +AC_CHECK_FUNCS([strrchr rindex], [break]) +AC_CHECK_FUNCS([memcpy bcopy], [break]) +AC_CHECK_FUNCS([memmove strcmp]) +])# AC_LIB_LTDL + + +# AC_LTDL_ENABLE_INSTALL +# ---------------------- +AC_DEFUN([AC_LTDL_ENABLE_INSTALL], +[AC_ARG_ENABLE([ltdl-install], + [AC_HELP_STRING([--enable-ltdl-install], [install libltdl])]) AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno) AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno) -])]) +])])# AC_LTDL_ENABLE_INSTALL -AC_DEFUN(AC_LTDL_SNARF_CONFIG, -[# Read the libtool configuration -rm -f conftest -./libtool --config > conftest -. ./conftest -rm -f conftest -]) - # AC_LTDL_SYS_DLOPEN_DEPLIBS # -------------------------- -AC_DEFUN(AC_LTDL_SYS_DLOPEN_DEPLIBS, +AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether deplibs are loaded by dlopen], - libltdl_cv_sys_dlopen_deplibs, [dnl - # PORTME does your system automatically load deplibs for dlopen()? - libltdl_cv_sys_dlopen_deplibs=unknown - case "$host_os" in - linux*) - libltdl_cv_sys_dlopen_deplibs=yes - ;; - netbsd*) - libltdl_cv_sys_dlopen_deplibs=yes - ;; - solaris*) - libltdl_cv_sys_dlopen_deplibs=yes - ;; - esac -]) + [libltdl_cv_sys_dlopen_deplibs], + [# PORTME does your system automatically load deplibs for dlopen? + # or its logical equivalent (e.g. shl_load for HP-UX < 11) + # For now, we just catch OSes we know something about -- in the + # future, we'll try test this programmatically. + libltdl_cv_sys_dlopen_deplibs=unknown + case "$host_os" in + aix3*|aix4.1.*|aix4.2.*) + # Unknown whether this is true for these versions of AIX, but + # we want this `case' here to explicitly catch those versions. + libltdl_cv_sys_dlopen_deplibs=unknown + ;; + aix[45]*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + gnu*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + irix[12345]*|irix6.[01]*) + # Catch all versions of IRIX before 6.2, and indicate that we don't + # know how it worked for any of those versions. + libltdl_cv_sys_dlopen_deplibs=unknown + ;; + irix*) + # The case above catches anything before 6.2, and it's known that + # at 6.2 and later dlopen does load deplibs. + libltdl_cv_sys_dlopen_deplibs=yes + ;; + linux*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + netbsd*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + openbsd*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + osf[1234]*) + # dlopen did load deplibs (at least at 4.x), but until the 5.x series, + # it did *not* use an RPATH in a shared library to find objects the + # library depends on, so we explictly say `no'. + libltdl_cv_sys_dlopen_deplibs=no + ;; + osf5.0|osf5.0a|osf5.1) + # dlopen *does* load deplibs and with the right loader patch applied + # it even uses RPATH in a shared library to search for shared objects + # that the library depends on, but there's no easy way to know if that + # patch is installed. Since this is the case, all we can really + # say is unknown -- it depends on the patch being installed. If + # it is, this changes to `yes'. Without it, it would be `no'. + libltdl_cv_sys_dlopen_deplibs=unknown + ;; + osf*) + # the two cases above should catch all versions of osf <= 5.1. Read + # the comments above for what we know about them. + # At > 5.1, deplibs are loaded *and* any RPATH in a shared library + # is used to find them so we can finally say `yes'. + libltdl_cv_sys_dlopen_deplibs=yes + ;; + solaris*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + esac + ]) if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then - AC_DEFINE(LTDL_DLOPEN_DEPLIBS, 1, - [Define if the OS needs help to load dependent libraries for dlopen(). ]) + AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1], + [Define if the OS needs help to load dependent libraries for dlopen().]) fi ])# AC_LTDL_SYS_DLOPEN_DEPLIBS -AC_DEFUN(AC_LTDL_SHLIBEXT, -[AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl + +# AC_LTDL_SHLIBEXT +# ---------------- +AC_DEFUN([AC_LTDL_SHLIBEXT], +[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER]) AC_CACHE_CHECK([which extension is used for shared libraries], - libltdl_cv_shlibext, [dnl -( - last= - for spec in $library_names_spec; do - last="$spec" + [libltdl_cv_shlibext], + [ac_last= + for ac_spec in $library_names_spec; do + ac_last="$ac_spec" done -changequote(, ) - echo "$last" | sed 's/\[.*\]//;s/^[^.]*//;s/\$.*$//;s/\.$//' > conftest -changequote([, ]) -) -libltdl_cv_shlibext=`cat conftest` -rm -f conftest -]) + echo "$ac_last" | [sed 's/\[.*\]//;s/^[^.]*//;s/\$.*$//;s/\.$//'] > conftest + libltdl_cv_shlibext=`cat conftest` + rm -f conftest + ]) if test -n "$libltdl_cv_shlibext"; then AC_DEFINE_UNQUOTED(LTDL_SHLIB_EXT, "$libltdl_cv_shlibext", - [Define to the extension used for shared libraries, say, ".so". ]) + [Define to the extension used for shared libraries, say, ".so".]) fi -]) +])# AC_LTDL_SHLIBEXT + -AC_DEFUN(AC_LTDL_SHLIBPATH, -[AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl +# AC_LTDL_SHLIBPATH +# ----------------- +AC_DEFUN([AC_LTDL_SHLIBPATH], +[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER]) AC_CACHE_CHECK([which variable specifies run-time library path], - libltdl_cv_shlibpath_var, [libltdl_cv_shlibpath_var="$shlibpath_var"]) + [libltdl_cv_shlibpath_var], [libltdl_cv_shlibpath_var="$shlibpath_var"]) if test -n "$libltdl_cv_shlibpath_var"; then AC_DEFINE_UNQUOTED(LTDL_SHLIBPATH_VAR, "$libltdl_cv_shlibpath_var", - [Define to the name of the environment variable that determines the dynamic library search path. ]) + [Define to the name of the environment variable that determines the dynamic library search path.]) fi -]) +])# AC_LTDL_SHLIBPATH + -AC_DEFUN(AC_LTDL_SYSSEARCHPATH, -[AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl +# AC_LTDL_SYSSEARCHPATH +# --------------------- +AC_DEFUN([AC_LTDL_SYSSEARCHPATH], +[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER]) AC_CACHE_CHECK([for the default library search path], - libltdl_cv_sys_search_path, [libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"]) + [libltdl_cv_sys_search_path], + [libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"]) if test -n "$libltdl_cv_sys_search_path"; then - case "$host" in - *-*-mingw*) pathsep=";" ;; - *) pathsep=":" ;; - esac sys_search_path= for dir in $libltdl_cv_sys_search_path; do if test -z "$sys_search_path"; then sys_search_path="$dir" else - sys_search_path="$sys_search_path$pathsep$dir" + sys_search_path="$sys_search_path$ac_path_separator$dir" fi done AC_DEFINE_UNQUOTED(LTDL_SYSSEARCHPATH, "$sys_search_path", - [Define to the system default library search path. ]) + [Define to the system default library search path.]) fi -]) +])# AC_LTDL_SYSSEARCHPATH + -AC_DEFUN(AC_LTDL_OBJDIR, +# AC_LTDL_OBJDIR +# -------------- +AC_DEFUN([AC_LTDL_OBJDIR], [AC_CACHE_CHECK([for objdir], - libltdl_cv_objdir, [libltdl_cv_objdir="$objdir" -if test -n "$objdir"; then - : -else - rm -f .libs 2>/dev/null - mkdir .libs 2>/dev/null - if test -d .libs; then - libltdl_cv_objdir=.libs + [libltdl_cv_objdir], + [libltdl_cv_objdir="$objdir" + if test -n "$objdir"; then + : else - # MS-DOS does not allow filenames that begin with a dot. - libltdl_cv_objdir=_libs + rm -f .libs 2>/dev/null + mkdir .libs 2>/dev/null + if test -d .libs; then + libltdl_cv_objdir=.libs + else + # MS-DOS does not allow filenames that begin with a dot. + libltdl_cv_objdir=_libs + fi + rmdir .libs 2>/dev/null fi -rmdir .libs 2>/dev/null -fi]) + ]) AC_DEFINE_UNQUOTED(LTDL_OBJDIR, "$libltdl_cv_objdir/", - [Define to the sub-directory in which libtool stores uninstalled libraries. ]) -]) + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# AC_LTDL_OBJDIR + -AC_DEFUN(AC_LTDL_DLPREOPEN, -[AC_REQUIRE([AC_LTDL_GLOBAL_SYMBOL_PIPE])dnl +# AC_LTDL_DLPREOPEN +# ----------------- +AC_DEFUN([AC_LTDL_DLPREOPEN], +[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE]) AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen], - libltdl_cv_preloaded_symbols, [dnl - if test -n "$global_symbol_pipe"; then + [libltdl_cv_preloaded_symbols], + [if test -n "$global_symbol_pipe"; then libltdl_cv_preloaded_symbols=yes else libltdl_cv_preloaded_symbols=no fi -]) -if test x"$libltdl_cv_preloaded_symbols" = x"yes"; then + ]) +if test x"$libltdl_cv_preloaded_symbols" = xyes; then AC_DEFINE(HAVE_PRELOADED_SYMBOLS, 1, - [Define if libtool can extract symbol lists from object files. ]) + [Define if libtool can extract symbol lists from object files.]) fi -]) +])# AC_LTDL_DLPREOPEN + -AC_DEFUN(AC_LTDL_DLLIB, +# AC_LTDL_DLLIB +# ------------- +AC_DEFUN([AC_LTDL_DLLIB], [LIBADD_DL= -AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL, 1, - [Define if you have the libdl library or equivalent. ]) LIBADD_DL="-ldl"], -[AC_CHECK_FUNC(dlopen, [AC_DEFINE(HAVE_LIBDL, 1, - [Define if you have the libdl library or equivalent.])], -[AC_CHECK_LIB(svld, dlopen, [AC_DEFINE(HAVE_LIBDL, 1, - [Define if you have the libdl library or equivalent.]) LIBADD_DL="-lsvld"] -)])]) -AC_CHECK_FUNC(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1, - [Define if you have the shl_load function.])], -[AC_CHECK_LIB(dld, shl_load, - [AC_DEFINE(HAVE_SHL_LOAD, 1, - [Define if you have the shl_load function.]) - LIBADD_DL="$LIBADD_DL -ldld"]) -]) -AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD, 1, - [Define if you have the GNU dld library.])dnl -test "x$ac_cv_lib_dld_shl_load" = yes || LIBADD_DL="$LIBADD_DL -ldld"]) AC_SUBST(LIBADD_DL) - -if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then - LIBS_SAVE="$LIBS" - LIBS="$LIBS $LIBADD_DL" - AC_CHECK_FUNCS(dlerror) - LIBS="$LIBS_SAVE" -fi +AC_LANG_PUSH([C]) + +AC_CHECK_FUNC([shl_load], + [AC_DEFINE([HAVE_SHL_LOAD], [1], + [Define if you have the shl_load function.])], + [AC_CHECK_LIB([dld], [shl_load], + [AC_DEFINE([HAVE_SHL_LOAD], [1], + [Define if you have the shl_load function.]) + LIBADD_DL="$LIBADD_DL -ldld"], + [AC_CHECK_LIB([dl], [dlopen], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + LIBADD_DL="-ldl"], + [AC_TRY_LINK([#if HAVE_DLFCN_H +# include +#endif + ], + [dlopen(0, 0);], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.])], + [AC_CHECK_LIB([svld], [dlopen], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + LIBADD_DL="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [AC_DEFINE([HAVE_DLD], [1], + [Define if you have the GNU dld library.]) + LIBADD_DL="$LIBADD_DL -ldld" + ]) + ]) + ]) + ]) + ]) ]) -AC_DEFUN(AC_LTDL_GLOBAL_SYMBOL_PIPE, -[dnl Check for command to grab the raw symbol name followed -dnl by C symbol name from nm. -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_PROG_NM])dnl -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output]) -AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe, -[# These are sane defaults that work on at least a few old systems. -# {They come from Ultrix. What could be older than Ultrix?!! ;)} - -changequote(,)dnl -# Character class describing NM global symbol codes. -ac_symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Transform the above into a raw symbol and a C symbol. -ac_symxfrm='\1 \2\3 \3' - -# Transform an extracted symbol line into a proper C declaration -ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" - -# Define system-specific variables. -case "$host_os" in -aix*) - ac_symcode='[BCDT]' - ;; -cygwin* | mingw*) - ac_symcode='[ABCDGISTW]' - ;; -hpux*) - ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'" - ;; -irix*) - ac_symcode='[BCDEGRST]' - ;; -solaris*) - ac_symcode='[BDT]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then - ac_symcode='[ABCDGISTW]' +if test x"$ac_cv_func_dlopen" = xyes || test x"$ac_cv_lib_dl_dlopen" = xyes +then + lt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBADD_DL" + AC_CHECK_FUNCS([dlerror]) + LIBS="$lt_save_LIBS" fi -changequote([,])dnl - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($ac_symcode\)[ ][ ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'" - - # Check to see that the pipe works correctly. - ac_pipe_works=no - rm -f conftest.$ac_ext +AC_LANG_POP +])# AC_LTDL_DLLIB + + +# AC_LTDL_SYMBOL_USCORE +# --------------------- +# does the compiler prefix global symbols with an underscore? +AC_DEFUN([AC_LTDL_SYMBOL_USCORE], +[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE]) +AC_CACHE_CHECK([for _ prefix in compiled symbols], + [ac_cv_sys_symbol_underscore], + [ac_cv_sys_symbol_underscore=no cat > conftest.$ac_ext < $ac_nlist) && test -s "$ac_nlist"; then - - # Try sorting and uniquifying the output. - if sort "$ac_nlist" | uniq > "$ac_nlist"T; then - mv -f "$ac_nlist"T "$ac_nlist" + if AC_TRY_EVAL(NM conftest.$ac_objext \| $global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then + # See whether the symbols have a leading underscore. + if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then + ac_cv_sys_symbol_underscore=yes else - rm -f "$ac_nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then - if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -changequote(,)dnl -lt_preloaded_symbols[] = -changequote([,])dnl -{ -EOF - sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - ac_save_LIBS="$LIBS" - ac_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$no_builtin_flag" - if AC_TRY_EVAL(ac_link) && test -s conftest; then - ac_pipe_works=yes - else - echo "configure: failed program was:" >&AC_FD_CC - cat conftest.$ac_ext >&AC_FD_CC - fi - LIBS="$ac_save_LIBS" - CFLAGS="$ac_save_CFLAGS" - else - echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC - fi - else - echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC + if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then + : + else + echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC + fi fi else - echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC + echo "configure: cannot run $global_symbol_pipe" >&AC_FD_CC fi else - echo "$progname: failed program was:" >&AC_FD_CC - cat conftest.$ac_ext >&AC_FD_CC + echo "configure: failed program was:" >&AC_FD_CC + cat conftest.c >&AC_FD_CC fi - rm -rf conftest* conftst* + rm -rf conftest* + ]) +])# AC_LTDL_SYMBOL_USCORE - # Do not use the global_symbol_pipe unless it works. - if test "$ac_pipe_works" = yes; then - if test x"$ac_symprfx" = x"_"; then - ac_cv_sys_symbol_underscore=yes - else - ac_cv_sys_symbol_underscore=no - fi - break - else - ac_cv_sys_global_symbol_pipe= - fi -done -]) - -ac_result=yes -if test -z "$ac_cv_sys_global_symbol_pipe"; then - ac_result=no -fi -AC_MSG_RESULT($ac_result) -]) - -AC_DEFUN(AC_LTDL_SYMBOL_USCORE, -[dnl does the compiler prefix global symbols with an underscore? -AC_REQUIRE([AC_LTDL_GLOBAL_SYMBOL_PIPE])dnl -AC_MSG_CHECKING([for _ prefix in compiled symbols]) -AC_CACHE_VAL(ac_cv_sys_symbol_underscore, -[ac_cv_sys_symbol_underscore=no -cat > conftest.$ac_ext < $ac_nlist) && test -s "$ac_nlist"; then - # See whether the symbols have a leading underscore. - if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then - ac_cv_sys_symbol_underscore=yes - else - if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then - : - else - echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC - fi - fi - else - echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC - fi -else - echo "configure: failed program was:" >&AC_FD_CC - cat conftest.$ac_ext >&AC_FD_CC -fi -rm -rf conftest* -]) -AC_MSG_RESULT($ac_cv_sys_symbol_underscore) -]) -AC_DEFUN(AC_LTDL_DLSYM_USCORE, -[AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])dnl +# AC_LTDL_DLSYM_USCORE +# -------------------- +AC_DEFUN([AC_LTDL_DLSYM_USCORE], +[AC_REQUIRE([AC_LTDL_SYMBOL_USCORE]) if test x"$ac_cv_sys_symbol_underscore" = xyes; then if test x"$ac_cv_func_dlopen" = xyes || test x"$ac_cv_lib_dl_dlopen" = xyes ; then AC_CACHE_CHECK([whether we have to add an underscore for dlsym], - libltdl_cv_need_uscore, [dnl - save_LIBS="$LIBS" - LIBS="$LIBS $LIBADD_DL" - AC_TRY_RUN([ -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LTDL_GLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LTDL_GLOBAL DL_GLOBAL -# else -# define LTDL_GLOBAL 0 -# endif -#endif - -/* We may have to define LTDL_LAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LTDL_LAZY_OR_NOW -# ifdef RTLD_LAZY -# define LTDL_LAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LTDL_LAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LTDL_LAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LTDL_LAZY_OR_NOW DL_NOW -# else -# define LTDL_LAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -void fnord() { int i=42;} -int main() { - void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); - if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); - if(ptr1 && !ptr2) { dlclose(self); exit(0); } } exit(1); } -], libltdl_cv_need_uscore=no, libltdl_cv_need_uscore=yes, - libltdl_cv_need_uscore=cross) - LIBS="$save_LIBS" -]) + [libltdl_cv_need_uscore], + [libltdl_cv_need_uscore=unknown + save_LIBS="$LIBS" + LIBS="$LIBS $LIBADD_DL" + _LT_AC_TRY_DLOPEN_SELF( + [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes], + [], [libltdl_cv_need_uscore=cross]) + LIBS="$save_LIBS" + ]) fi fi if test x"$libltdl_cv_need_uscore" = xyes; then AC_DEFINE(NEED_USCORE, 1, - [Define if dlsym() requires a leading underscode in symbol names. ]) + [Define if dlsym() requires a leading underscore in symbol names.]) fi -]) +])# AC_LTDL_DLSYM_USCORE + +# AC_LTDL_FUNC_ARGZ +# ----------------- +AC_DEFUN([AC_LTDL_FUNC_ARGZ], +[AC_CHECK_HEADERS([argz.h]) + +AC_CHECK_TYPES([error_t], + [], + [AC_DEFINE([error_t], [int], + [Define to a type to use for `error_t' if it is not otherwise available.])], + [#if HAVE_ARGZ_H +# include +#endif]) + +AC_CHECK_FUNCS([argz_append argz_create_sep argz_insert argz_next argz_stringify]) +])# AC_LTDL_FUNC_ARGZ diff --git a/mail/cygwin32 b/mail/cygwin32 index 45b2f1ee7..f337a207e 100644 --- a/mail/cygwin32 +++ b/mail/cygwin32 @@ -200,3 +200,761 @@ Jon Leichter jon@symas.com +"Gary V. Vaughan" wrote: +> +> On Wed, Aug 30, 2000 at 10:51:36AM -0400, Charles Wilson wrote: +> > No, it can't. Currently, libtool itself doesn't support *building* +> > dlls. +> +> Ouch. Yes it does. I added support around Christmas 1998, and have +> been maintaining it ever since. + +Thanks for the correction. + +> +> Yes it does. And provided your libraries don't trip over the stupid +> dll limitation of "to export a non-function symbol you must edit your +> sources", it works easily. Even if you do export data symbols, +> libtool woll build and link against a dll for you (even generating an +> import lib along the way). +> +> Unfortunately libtool was developed for Unix and assumes a featureful +> shared library architecture, which doesn't map very easily onto win32 +> dll's. +> +> I will be able to simplify the dll build process a little when DJ's +> patches to binutils arrive in a cygwin release (did this happen in +> 1.1? I have been so busy with m4 that I only upgraded from b20.1 a few +> weeks ago). + +They landed in binutils-20000625, and were finetuned/tweaked to a fairly +stable point by binutils-20000722 (the current version in /latest). + +Also, there were a few additions that changed ld's default search order +for libraries: + -Bstatic -lfoo : + looks for libfoo.a + -Bdynamic -lfoo : + looks for libfoo.dll.a (default name for an import lib) + then foo.dll.a (alt. name for an import lib) + then libfoo.dll (link directly to a dll) + then foo.dll (ditto, alt. name) + finally, libfoo.a (fall back to static lib) + +The spec file for gcc (as of 2.95.2-2) changed so that: + gcc -static calls 'ld -Bstatic' + gcc calls 'ld -Bdynamic' + +Finally, 'gcc -shared' will build a dll, but you need to pass linker +options like '-Wl,--out-implib=libfoo.dll.a' explicitly. + +FWIW, all of the (non-libtool) libraries I've dll-ized do not use +dlltool at all, and rely only on gcc (and ld, indirectly). + +--Chuck + +-- +Want to unsubscribe from this list? +Send a message to cygwin-unsubscribe@sourceware.cygnus.com +From gary Tue Oct 3 18:51:55 2000 +Return-Path: +Received: from pop3.mail.demon.net + by localhost with POP3 (fetchmail-5.3.4) + for gary@localhost (single-drop); Tue, 03 Oct 2000 18:51:55 +0100 (BST) +Received: from punt-2.mail.demon.net by mailstore + for gvaughan@oranda.demon.co.uk id 970581289:20:22249:24; + Tue, 03 Oct 2000 13:54:49 GMT +Received: from sourceware.cygnus.com ([205.180.83.71]) by punt-2.mail.demon.net + id aa2022220; 3 Oct 2000 13:54 GMT +Received: (qmail 29977 invoked by alias); 3 Oct 2000 13:52:38 -0000 +Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm +Precedence: bulk +List-Unsubscribe: +List-Subscribe: +List-Archive: +List-Post: +List-Help: , +Sender: cygwin-owner@sources.redhat.com +Delivered-To: mailing list cygwin@sources.redhat.com +Received: (qmail 29933 invoked from network); 3 Oct 2000 13:52:34 -0000 +Received: from mumnunah.cs.mu.oz.au (203.19.244.130) + by sourceware.cygnus.com with SMTP; 3 Oct 2000 13:52:34 -0000 +Received: from murlibobo.cs.mu.OZ.AU (murlibobo.cs.mu.OZ.AU [128.250.29.17]) by mumnunah.cs.mu.OZ.AU with ESMTP + id AAA23121; Wed, 4 Oct 2000 00:52:14 +1100 (EST) +Received: (from fjh@localhost) by murlibobo.cs.mu.OZ.AU (8.8.5/8.7.3) id AAA11289; Wed, 4 Oct 2000 00:52:13 +1100 (EST) +Date: Wed, 4 Oct 2000 00:52:13 +1100 +From: Fergus Henderson +To: "Gary V. Vaughan" , cygwin@sources.redhat.com, + cgf@cygnus.com +Subject: Re: linking against shared libraries +Message-ID: <20001004005212.A9274@murlibobo.cs.mu.OZ.AU> +References: <012a01c02033$936effc0$f7c723cb@lifelesswks> <20000917010735.G606@demon.co.uk> <20000916234420.A23827@cygnus.com> <20000917122440.I606@demon.co.uk> <20000917122837.A24997@cygnus.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Mailer: Mutt 0.95.1i +In-Reply-To: <20000917122837.A24997@cygnus.com>; from Chris Faylor on Sun, Sep 17, 2000 at 12:28:37PM -0400 +Status: RO +Content-Length: 2625 +Lines: 51 + +On 17-Sep-2000, Chris Faylor wrote: +> On Sun, Sep 17, 2000 at 12:24:40PM +0100, Gary V. Vaughan wrote: +> >If you are interested, I will add an entry to my TODO list to see if I +> >can take some of the nicities from the libtldl LoadLibrary wrapper +> >code and apply them to the Cygwin LoadLibrary wrapper? (Automatic `_' +> >prefixing for example). +> +> Is this a characteristic of normal linux/UNIX dlsym? + +AFAIK, Unix systems that support dlopen() don't prefix C symbol +names with `_' when compiling them to assembler in the first place, +so the issue is moot. At least this is the case on Solaris (2.7), +Linux (>= libc6), and OSF1 (3.2 ), which are the systems that +I have easily available right now. dlopen() originated on Solaris, +according to the Linux man page. + +On systems such as Cygwin which do prefix C names with `_' when +compiling to assembler, whether dlopen() should prefix the name with an +underscore depends on whether the name that the user is trying to look +up is an assembly name or a C name. If it's a C name, then it's right +for dlopen() to prefix the name with an underscore, to match what the +C compiler does, but if it's an assembly name, then doing that would +be wrong. Unfortunately the interface to dlopen() provides the +dlopen() implementation with no clues as to which one the user meant. +The documentation for dlopen() says that the argument is the "symbol +name", which is ambiguous, but could be read as implying that it is +supposed to be the assembly name. However, in practice most uses of +dlopen() tend to be passing C names rather than assembler names. + +Probably most uses of dlopen() are for C names, and so inserting +the prefix would work well in most cases. However, inserting the +prefix would also make it impossible to look up assember names that +don't start with underscore using dlopen(). + +It's a bit like the issue of text-versus-binary: +the original unix-only interface didn't need to distinguish +between the different cases (text/binary or C/asm/whatever), +but in the Windows environment, you do need to make such +distinctions. So some programs will need source modifications. +The best you can do is to choose the default carefully, +and make it easy to override the default for programs for which +the default is not appropriate. + +-- +Fergus Henderson | "I have always known that the pursuit +WWW: | of excellence is a lethal habit" +PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp. + +-- +Want to unsubscribe from this list? +Send a message to cygwin-unsubscribe@sourceware.cygnus.com + +On Sun, Sep 03, 2000 at 01:34:23AM -0400, Charles Wilson wrote: +> "Gary V. Vaughan" wrote: +> +> > > Now, suppose that the png folks release a newer version, say png-2.1.x +> > > that exposes some additional features, but is backwards compatible with +> > > png-2.0.x. Great. You build it, but create: +> > > +> > > libpng31.dll.a (embeds the name libpng31.dll.a) +> > > libpng.dll.a -> libpng31.dll.a +> > > libpng3.dll (replaces the old version (*)) +> > +> > I don't think we need anything more than +> > +> > a replacement libpng3.dll +> +> Not so. Remember, libpng-2.1.x can include additional functions that +> were not included by libpng-2.0.x, as long as it includes all of the +> 'old' functions/vars without modification. So, you need to update the +> import lib as well as the dll, so that new packages that use the +> additional functions will work. + +Oops. I hadn't thought of that. Good point. + +> > Otherwise we are still in violent agreement. +> +> I agree. + +=)O| + +> > > > Maybe Cygwin should put all of it's libtool built libraries (or any +> > > > others that are correctly versioned w.r.t the runtime loader) into a +> > > > single directory that is near the front of the default path. /usr/lib +> > > > seems like a good place. +> > > +> > > That's part of my 'easy' solution above. It may fix the cygwin problem, +> > > but the requirement is not nice to native apps or other unix-on-win +> > > emulations that the user may have. +> > > +> > > Relying on 'get dll's from same dir as .exe' works -- but only if EVERY +> > > cygwin exe and EVERY cygwin dll are piled into the same dir. +> > +> > Can't we assume that the native dll's we rely on are outside cygwin's +> > control and can be relied upon to be managed by the operating system +> > (I'm thinking of stuff in the SYSTEM directory), and that non-cygwin +> > libraries (such as Pauls pw dlls) will not be installed into the +> > cygwin binary search path? In which case I think it is okay to +> > install all cygwin dlls and import libs to /usr/lib, making sure that +> > cygwin.bat (or any other cygwin startup methods) put /usr/lib first in +> > $PATH. +> +> this works for the 'sandbox user' -- Michael Ring's 'user 1' in this +> message: +> http://sources.redhat.com/ml/cygwin/2000-08/msg01241.html +> +> It doesn't work for Michael's 'user 2' -- the guy who normally runs in +> cmd.exe/command.com, but relies on cygwin commands every once in a +> while. He doesn't use bash, but likes the cygwin-perl or grep every +> once and a while. User 2 will have the cygwin directories somewhere in +> her path -- but not necessarily first. + +We could tell these people to put C:/cygwin/usr/bin at the front of +their PATH... + +> > Does cygwin ld use -rpath yet? +> +> I don't think so. -rpath is something that ld.so uses; Windows doesn't +> have ld.so. Windows *always* loads dll's according to the following +> search order: +> current directory +> app's load directory +> global executable search path +> +> The only two exceptions I know of are: +> +> 1) In Win2K, if there is a file called 'app.exe.local' in the same +> directory as app.exe, then all dll's will be loaded from the app's load +> directory -- even if explicitly dlopened() with an absolute path that +> points elsewhere. the .local. may also override the 'current directory' +> part of the search order listed above, but I'm not sure. + +Holy cr@p! What happened to simplicity? If Bill has decided that he +can't understand how to write a decent shared library system, and +want's to relegate dll's to LoadLibrary() objects, why doesn't he just +say so? Wouldn't it be easier to statically link a Win2k program that +twiddle about with all this .local mess? + +> 2) You can put something called 'AppPath' in the registry, which will +> influence the directories that are searched. I don't know where in the +> list above that the directories listed in the 'AppPath' key are +> inserted. + +This sounds promising. I'll see if I can find any details on it. + +> > I am prepared to work on having libtool do the right thing as far +> > as possible. +> +> What was the right thing, again? :-) + +Based on our conversation so far: + + * When building a libtool (.la) library, create libfoo.la, + libfoo.dll, libfoo.dll.a and libfoo.a, where: + - is the earliest fully supported interface number + - libfoo.dll.a is the import library for libfoo.dll + + * When installing a libtool (.la) library: + - libfoo.la goes to $prefix/lib + - libfoo.dll goes to $prefix/bin + - libfoo.dll.a goes to $prefix/lib + - libfoo.a goes to $prefix/lib + + * When linking against libfoo.la + - use libfoo.dll.a unless -static or -all-static + - otherwise use libfoo.a + + * When linking against -lfoo + - if libfoo.la is found, behave as above + - else let ld (or gcc) do its thing + +Which is especially cool, because I don't think I need to worry about +dealing with direct linkage to dlls (I can just punt and let gcc/ld do +the hard work) which removes a whole pile of spaghetti where I had to +cope with compiling the impgen code correctly in cross compilation +environments! + +> > By default libtool always searches for a dll to link against and +> > generates the implib on the fly if a suitable one is found. + +This won't be necessary under the new scheme =)O| + +> There are occaisions where you want to link to an import lib in +> preference to a dll -- for instance, libcygwin.a is an import lib, but +> contains initializer code and actual function implementations for some +> functions that are not included in the dll itself. If you attempt to +> link directly to cygwin1.dll, the link fails because those things are +> missing from the virtual on-the-fly implib. + +I didn't know about that. Thanks. + +> But where do you put the dll? It has to go into the executable PATH so +> that the windows loader can find it. Do you copy it into /usr/lib, so +> that the default ld search path will find it? Do you add /usr/bin to +> the linktime library search path (-L/usr/bin)? Perhaps a symlink in +> /usr/lib, pointing to /usr/bin/libfoo.dll is all you need. +> +> However!!! Ld uses the following library name search order when hunting +> for -lfoo: +> +> libfoo.dll.a +> foo.dll.a +> libfoo.a <<<< NOTE!! +> libfoo.dll +> foo.dll + +Or that. Thanks again! Libtool already provides --disable-static if +the user wants to build and install only the dll parts of the library. + +For this to work (that is, in order for me to be able to punt to gcc/ld +in the majority of cases) I must generate dll names that will be +found, so the cygfoo.dll idea is out (Sorry Paul!). + +Although this doesn't help ``User 2'' very much, he is no worse off +than before if I change libtool's behaviour in this way. Here's a +thought: For each dll using application linked, I could have libtool +install a .bat script to C:/cygwin/launch (or similar) which would set +the PATH environment correctly for that application. As long as +``User 2'' has the launch directory higher in his PATH than the actual +binary directory, this would guarantee correct dll selection. + +This would give ``User 1'' many of the advantages shared libraries +offer on Unix, without sinking into DLL Hell. Assuming that everyone +buys into it. The only reason shared libraries work properly on Unix +is that everyone has to agree to conform to the runtime loader's +versioning scheme -- so don't give some excuse about ``if we don't +want to change the core cygwin dll's to conform this won't work''. On +my linux box, I can move my libc around or drop several incompatible +versions of libc into my filesystem, and my applications will stop +loading the intended libraries too. No surprises there! + +Cheers, + Gary. +-- + ___ _ ___ __ _ mailto: gvv@techie.com + / __|__ _ _ ___ _| | / / | / /_ _ _ _ __ _| |_ __ _ ___ gary@gnu.org +| (_ / _` | '_|// / |/ /| |/ / _` | || / _` | ' \/ _` | _ \ + \___\__,_|_|\_, /|___(_)___/\__,_|\_,_\__, |_||_\__,_|//_/ +home page: /___/ /___/ gpg public key: +http://www.oranda.demon.co.uk http://www.oranda.demon.co.uk/key.asc + +-- +Want to unsubscribe from this list? +Send a message to cygwin-unsubscribe@sourceware.cygnus.com +On Sun, Sep 03, 2000 at 04:39:51PM -0300, Alexandre Oliva wrote: +> On Sep 3, 2000, "Gary V. Vaughan" wrote: +> +> > * When installing a libtool (.la) library: +> > - libfoo.la goes to $prefix/lib +> > - libfoo.dll goes to $prefix/bin +> > - libfoo.dll.a goes to $prefix/lib +> > - libfoo.a goes to $prefix/lib +> +> Nope. libfoo.la goes wherever -rpath specified when the library was +> created; it should be the same directory that is specified at install +> time. This is often $(libdir), but it doesn't have to be. +> +> I don't know how to arrange for an additional directory (bindir) to +> be specifiable without introducing an additional command-line option. +> Remember, libtool doesn't know about prefix, libdir or bindir, it just +> knows about what it's given in the command line. + +Hmm. I hadn't thought of that. Still, at least the principle of the +thing is right now, I think... + +Cheers, + Gary. +-- + ___ _ ___ __ _ mailto: gvv@techie.com + / __|__ _ _ ___ _| | / / | / /_ _ _ _ __ _| |_ __ _ ___ gary@gnu.org +| (_ / _` | '_|// / |/ /| |/ / _` | || / _` | ' \/ _` | _ \ + \___\__,_|_|\_, /|___(_)___/\__,_|\_,_\__, |_||_\__,_|//_/ +home page: /___/ /___/ gpg public key: +http://www.oranda.demon.co.uk http://www.oranda.demon.co.uk/key.asc + +There's an easier way -- one command! 'gcc -shared' will create a dll +for you. Just do: + +$(BASE)=foo + + gcc -shared -o cyg$(BASE).dll -Wl,--out-implib=lib$(BASE).dll.a \ + -Wl,--export-all -Wl,--enable-auto-image-base \ + -Wl,--output-def=cyg$(BASE).def $(OBJS) + +Grab any of the packages in the 'contrib' directory and look an the +makefiles (you might need to do a minimal 'configure' first, to +customize the Makefile for cygwin before using it as a model) + +--Chuck + +Jrgen Schuck wrote: +> +> I'm not sure about the kind of object that 'gcc -shared' +> produces. But I think it won't be what you might expect. +> In Windows shared sobjects are DLL's. You probably will +> have to convert your Makefiles to cproduce DLL's instead +> of UNIX-style .so files. +> +> I did the same task when porting a TCL-extension from +> UNIX to Cygwin. The Makefile (SVR4) changes from +> +> libTclDM20.so: +> ld -G -o $@ $(OBJS) +> +> to +> +> LOAD = TclDM20 +> DEF = $(LOAD).def +> BAS = $(LOAD).base +> EXP = $(LOAD).exp +> $(DLL): $(OBJS) +> echo EXPORTS >$(DEF) +> nm $+ | grep '^........ [T] _' | sed 's/[^_]*_//' >>$(DEF) +> $(LD) --base-file $(BAS) -dll -o $@ $+ -e _dll_entry@12 \ +> -L`dirname \`gcc -print-file-name=libgcc.a\`` \ +> $(LIBS) -lgcc -lcygwin -lkernel32 -lgcc +> dlltool --as=as -dllname $@ --def $(DEF) \ +> --base-file $(BAS) --output-exp $(EXP) +> $(LD) --base-file $(BAS) $(EXP) -dll -o $@ $+ -e _dll_entry@12 \ +> -L`dirname \`gcc -print-file-name=libgcc.a\`` \ +> $(LIBS) -lgcc -lcygwin -lkernel32 -lgcc +> dlltool --as=as -dllname $@ --def $(DEF) \ +> --base-file $(BAS) --output-exp $(EXP) +> $(LD) $(EXP) -dll -o $@ $+ -e _dll_entry@12 \ +> -L`dirname \`gcc -print-file-name=libgcc.a\`` \ +> $(LIBS) -lgcc -lcygwin -lkernel32 -lgcc +> +> For further information see +> http://sources.redhat.com/cygwin/docs.html, +> section "Writing DLLs". Reading these docs you +> will find two further modules: dll_init.c and +> dll_fixup.c. I didn't put them into my DLL because +> the resulting DLL crashes the TCL-interpreter. +> +> Furthermore I found it very helpful to take a +> look into the Makefiles of the DLL-generating +> packages of the Cygwin-distribution: tcl, wish +> and tix. +> +> Jrgen Schuck +> PCM-Kundenbetreuung +> Business Unit Information +> _________________________________________________ +> MATERNA GmbH Information & Communications +> Vosskuhle 37 * 44141 Dortmund +> Tel.: 0231 - 5599 - 191 * Fax: -272 +> Handy: 0172 - 23 70 148 * http://www.materna.de +> +> -- +> Want to unsubscribe from this list? +> Send a message to cygwin-unsubscribe@sourceware.cygnus.com + +-- +Want to unsubscribe from this list? +Send a message to cygwin-unsubscribe@sourceware.cygnus.com +From gary Tue Oct 10 18:50:22 2000 +Return-Path: +Received: from pop3.mail.demon.net + by localhost with POP3 (fetchmail-5.3.4) + for gary@localhost (single-drop); Tue, 10 Oct 2000 18:50:22 +0100 (BST) +Received: from punt-2.mail.demon.net by mailstore + for gvaughan@oranda.demon.co.uk id 971135226:20:06380:2; + Mon, 09 Oct 2000 23:47:06 GMT +Received: from sourceware.cygnus.com ([205.180.83.71]) by punt-2.mail.demon.net + id aa2005552; 9 Oct 2000 23:46 GMT +Received: (qmail 16236 invoked by alias); 9 Oct 2000 23:46:45 -0000 +Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm +Precedence: bulk +List-Unsubscribe: +List-Subscribe: +List-Archive: +List-Post: +List-Help: , +Sender: cygwin-owner@sources.redhat.com +Delivered-To: mailing list cygwin@sources.redhat.com +Received: (qmail 16211 invoked from network); 9 Oct 2000 23:46:43 -0000 +Received: from mail.ee.gatech.edu (130.207.230.10) + by sourceware.cygnus.com with SMTP; 9 Oct 2000 23:46:43 -0000 +Received: from ece.gatech.edu (s02-pm03.gatech.campuscwix.net [168.14.1.69]) + by mail.ee.gatech.edu (8.11.0/8.11.0) with ESMTP id e99NkTO15440; + Mon, 9 Oct 2000 19:46:30 -0400 (EDT) +Message-ID: <39E259A7.CBAD325F@ece.gatech.edu> +Date: Mon, 09 Oct 2000 19:49:59 -0400 +From: Charles Wilson +X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) +X-Accept-Language: en +MIME-Version: 1.0 +To: cygwin@sourceware.cygnus.com +Subject: Re: AW: Linking Dynamic Libraries +References: <004501c031f0$10478ad0$0d33028b@zapperlot.materna.de> <39E1CC08.F475851F@ece.gatech.edu> <39E2468B.BFDD3AB7@ihug.co.nz> +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +Status: RO +Content-Length: 5252 +Lines: 189 + +You still need to worry about things like __declspec(dllexport) and +__declspec(dllimport). Here's a patch for your files. + +(Yes, you are correct; the option is '--export-all-symbols' not +'--export-all') + +As far as documentation, there's the mailing list, and 'ld --help' and +Mumit's (really out-of-date) dll-helpers packaqe at +http://www.xraylith.wisc.edu/~khan/software/gnu-win32/dllhelpers.html. +Would you like to update that package for the current capabilities of +ld/gcc ? Mumit's tutorial is heavily 'dlltool' based, rather than 'gcc +-shared' or 'ld' based. + +NOTE 1: I had to remove "-Wl,--export-all-symbols" from the options; +with export-all I got a stack dump even with my other changes. I'm not +sure why. + +NOTE 2: I used the extension '.dll.a' for the import library; cygwin's +linker will search for 'libfoo.dll.a' in preference to 'libfoo.a'; +libfoo.a is assumed to be a static library (although the linker will use +libfoo.a if .dll.a is not found) + +--Chuck + + +diff -u demo-orig/Makefile demo/Makefile +--- demo-orig/Makefile Mon Oct 9 19:34:15 2000 ++++ demo/Makefile Mon Oct 9 19:45:10 2000 +@@ -3,7 +3,7 @@ + EXENAME = demo + EXEOBJ = demo.o + CPLUS = g++ -W -Wall -Werror +-LINKDLL = g++ -shared -Wl,--export-all -Wl,--enable-auto-image-base ++LINKDLL = g++ -shared -Wl,--enable-auto-image-base + LINKEXE = g++ -L. + + .DELETE_ON_ERROR: +@@ -13,13 +13,16 @@ + all: $(DLLNAME).dll $(EXENAME) + + clean: +- rm -f $(DLLOBJ) $(DLLNAME).dll lib$(DLLNAME).a $(EXEOBJ) +$(EXENAME).exe ++ rm -f $(DLLOBJ) $(DLLNAME).dll lib$(DLLNAME).dll.a $(EXEOBJ) +$(EXENAME).exe + + %.o: %.cpp + $(CPLUS) -c $< -o $@ + ++$(DLLOBJ): $(DLLOBJ:.o=.cpp) ++ $(CPLUS) -DBUILD_DLL -c $< -o $@ ++ + $(DLLNAME).dll: $(DLLOBJ) +- $(LINKDLL) $(DLLOBJ) -o $(DLLNAME).dll +-Wl,--out-implib=lib$(DLLNAME).a ++ $(LINKDLL) $(DLLOBJ) -o $(DLLNAME).dll +-Wl,--out-implib=lib$(DLLNAME).dll.a + + $(EXENAME): $(EXEOBJ) $(DLLNAME).dll + $(LINKEXE) $(EXEOBJ) -l$(DLLNAME) -o $(EXENAME) +diff -u demo-orig/foo.hpp demo/foo.hpp +--- demo-orig/foo.hpp Mon Oct 9 19:35:58 2000 ++++ demo/foo.hpp Mon Oct 9 19:35:50 2000 +@@ -3,7 +3,12 @@ + + #include + +-extern std::string global_mangle(const std::string& source); +- ++#ifdef BUILD_DLL ++#define FOO_EXPORT __declspec(dllexport) ++#else ++#define FOO_EXPORT __declspec(dllimport) + #endif + ++extern FOO_EXPORT std::string global_mangle(const std::string& source); ++ ++#endif + +Ross Smith wrote: +> +> "Charles S. Wilson" wrote: +> > +> > There's an easier way -- one command! 'gcc -shared' will create a dll +> > for you. Just do: +> > +> > $(BASE)=foo +> > +> > gcc -shared -o cyg$(BASE).dll -Wl,--out-implib=lib$(BASE).dll.a \ +> > -Wl,--export-all -Wl,--enable-auto-image-base \ +> > -Wl,--output-def=cyg$(BASE).def $(OBJS) +> +> I can't get this to work. Whenever I link with the import lib produced +> this way, the resulting program crashes with a STATUS_ACCESS_VIOLATION. +> (See attached code.) I don't even need to call any of the DLL functions +> to trigger it -- just linking with -lfoo makes it unworkable. What am I +> doing wrong? +> +> And where is all this stuff documented anyway? The ld docs mention +> --export-all-symbols (not --export-all), but not any of the others. +> +> -------------------- cut here -------------------- +> +> // demo.cpp +> +> #include "foo.hpp" +> #include +> #include +> +> int main() { +> std::string thing("thing"); +> std::cout << thing << std::endl; +> // std::cout << global_mangle(thing) << std::endl; +> return 0; +> } +> +> -------------------- cut here -------------------- +> +> // foo.hpp +> +> #ifndef FOO_HEADER +> #define FOO_HEADER +> +> #include +> +> extern std::string global_mangle(const std::string& source); +> +> #endif +> +> -------------------- cut here -------------------- +> +> // foo.cpp +> +> #include "foo.hpp" +> +> std::string global_mangle(const std::string& source) { +> return source + "_global"; +> } +> +> -------------------- cut here -------------------- +> +> // Makefile +> +> DLLNAME = foo +> DLLOBJ = foo.o +> EXENAME = demo +> EXEOBJ = demo.o +> CPLUS = g++ -W -Wall -Werror +> LINKDLL = g++ -shared -Wl,--export-all -Wl,--enable-auto-image-base +> LINKEXE = g++ -L. +> +> .DELETE_ON_ERROR: +> +> .PHONY: all clean +> +> all: $(DLLNAME).dll $(EXENAME) +> +> clean: +> rm -f $(DLLOBJ) $(DLLNAME).dll lib$(DLLNAME).a $(EXEOBJ) +> $(EXENAME).exe +> +> %.o: %.cpp +> $(CPLUS) -c $< -o $@ +> +> $(DLLNAME).dll: $(DLLOBJ) +> $(LINKDLL) $(DLLOBJ) -o $(DLLNAME).dll +> -Wl,--out-implib=lib$(DLLNAME).a +> +> $(EXENAME): $(EXEOBJ) $(DLLNAME).dll +> $(LINKEXE) $(EXEOBJ) -l$(DLLNAME) -o $(EXENAME) +> +> demo.o: demo.cpp foo.hpp +> foo.o: foo.cpp foo.hpp +> +> -------------------- cut here -------------------- +> +> -- +> Ross Smith The Internet Group, Auckland, New Zealand +> ======================================================================== +> "C++ is to programming as sex is to reproduction. Better ways might +> technically exist but they're not nearly as much fun." -- Nikolai Irgens +> +> -- +> Want to unsubscribe from this list? +> Send a message to cygwin-unsubscribe@sourceware.cygnus.com + +-- +Want to unsubscribe from this list? +Send a message to cygwin-unsubscribe@sourceware.cygnus.com + +From gary Wed Oct 11 18:38:50 2000 +Return-Path: +Received: from pop3.mail.demon.net + by localhost with POP3 (fetchmail-5.3.4) + for gary@localhost (single-drop); Wed, 11 Oct 2000 18:38:50 +0100 (BST) +Received: from punt-1.mail.demon.net by mailstore + for gvaughan@oranda.demon.co.uk id 971256552:10:18423:4; + Wed, 11 Oct 2000 09:29:12 GMT +Received: from sourceware.cygnus.com ([205.180.83.71]) by punt-1.mail.demon.net + id aa1018296; 11 Oct 2000 9:29 GMT +Received: (qmail 10937 invoked by alias); 11 Oct 2000 09:28:33 -0000 +Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm +Precedence: bulk +List-Unsubscribe: +List-Subscribe: +List-Archive: +List-Post: +List-Help: , +Sender: cygwin-owner@sources.redhat.com +Delivered-To: mailing list cygwin@sources.redhat.com +Received: (qmail 10909 invoked from network); 11 Oct 2000 09:28:30 -0000 +Received: from web6405.mail.yahoo.com (128.11.22.153) + by sourceware.cygnus.com with SMTP; 11 Oct 2000 09:28:30 -0000 +Message-ID: <20001011092829.19377.qmail@web6405.mail.yahoo.com> +Received: from [203.97.2.247] by web6405.mail.yahoo.com; Wed, 11 Oct 2000 22:28:29 NZDT +Date: Wed, 11 Oct 2000 22:28:29 +1300 (NZDT) +From: =?iso-8859-1?q?Danny=20Smith?= +Subject: Re: AW: Linking Dynamic Libraries +To: cygwin@sources.redhat.com +MIME-Version: 1.0 +Content-Type: text/plain; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit +Status: RO +Content-Length: 1133 +Lines: 38 + +Ross Smith wrote: +> +> Charles Wilson wrote: +> > +> > You still need to worry about things like __declspec(dllexport) and +> > __declspec(dllimport). +> +> What's the point of --export-all-symbols then? I was under the +> impression that it was intended to duplicate the Unix convention, +where +> all external symbols are automatically exported from a .so. +(Actually, +> the help refers to "global" symbols, not "external", but I assumed +that +> just meant that whoever wrote the help didn't know C++.) + + +If you really want to --export-all in C++, this is a workaround. +Create a def with dlltool: + dlltool --export-all --output-def foo_.def --dllname foo.dll *.o + +Then look at the def file. Do you still really want to export-all? + +To use that def file with ld -shared you need to get rid of the +comments (demangled names) +cut does the job: + cut -d ';' -f 1 foo_.def >foo.def + +Cheers + + +_____________________________________________________________________________ +http://clubs.yahoo.com.au - Yahoo! Clubs +- Join a club or build your own! + +-- +Want to unsubscribe from this list? +Send a message to cygwin-unsubscribe@sourceware.cygnus.com + diff --git a/mdemo/Makefile.am b/mdemo/Makefile.am index 08236ada1..e89982ba1 100644 --- a/mdemo/Makefile.am +++ b/mdemo/Makefile.am @@ -2,20 +2,23 @@ AUTOMAKE_OPTIONS = no-dependencies foreign -INCLUDES = -I$(srcdir)/../libltdl +INCLUDES = $(INCLTDL) EXTRA_DIST = acinclude.m4 -lib_LTLIBRARIES = foo1.la libfoo2.la +lib_LTLIBRARIES = libsub.la foo1.la libfoo2.la foo1_la_SOURCES = foo1.c -foo1_la_LIBADD = $(LIBM) +foo1_la_LIBADD = $(LIBM) libsub.la foo1_la_LDFLAGS = -module -avoid-version libfoo2_la_SOURCES = foo2.c -libfoo2_la_LIBADD = $(LIBM) +libfoo2_la_LIBADD = $(LIBM) libsub.la libfoo2_la_LDFLAGS = -no-undefined -module -export-symbols-regex "libfoo2.*" +libsub_la_SOURCES = sub.c +libsub_la_LDFLAGS = -no-undefined + noinst_HEADERS = foo.h bin_PROGRAMS = mdemo mdemo.static @@ -33,9 +36,9 @@ bin_PROGRAMS = mdemo mdemo.static mdemo_SOURCES = main.c mdemo_LDFLAGS = -export-dynamic ## The quotes around -dlopen below fool automake into accepting it -mdemo_LDADD = @LIBLTDL@ "-dlopen" self \ +mdemo_LDADD = @LIBLTDL@ libsub.la "-dlopen" self \ "-dlopen" foo1.la "-dlopen" libfoo2.la -mdemo_DEPENDENCIES = @LIBLTDL@ foo1.la libfoo2.la +mdemo_DEPENDENCIES = @LIBLTDL@ libsub.la foo1.la libfoo2.la # Create a statically linked version of mdemo. mdemo_static_SOURCES = $(mdemo_SOURCES) diff --git a/mdemo/README b/mdemo/README index adb625562..936396a9b 100644 --- a/mdemo/README +++ b/mdemo/README @@ -8,3 +8,10 @@ wrapper called "libltdl". All exported symbols are prefixed with "libname_LTX_" to avoid symbols conflicts, especially when linking statically. libltdl will automatically cut the prefix off to get the real name. + +Note that on Windows, for the purposes of illustrating ltdl, the +libraries *are* built as dll's, but do not have the __declspec +machinery to make them suitable for loading at link time. This is +only for clarity inside this example, look at the example in ../demo +to see how the __declspec macros should be set up. + diff --git a/mdemo/configure.ac b/mdemo/configure.ac new file mode 100644 index 000000000..e7f9121b2 --- /dev/null +++ b/mdemo/configure.ac @@ -0,0 +1,79 @@ +## Process this file with autoconf to create configure. -*- autoconf -*- +# Copyright 2001 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA + +AC_PREREQ(2.50) + + +## ------------------------ ## +## Autoconf initialisation. ## +## ------------------------ ## +AC_INIT([mdemo], [0.1], [bug-libtool@gnu.org]) +AC_CONFIG_SRCDIR([main.c]) + + +## ------------------------ ## +## Automake Initialisation. ## +## ------------------------ ## +AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION) + + +## ------------------ ## +## C compiler checks. ## +## ------------------ ## +AC_PROG_CC +AC_C_CONST + + +## ----------------------- ## +## Libtool initialisation. ## +## ----------------------- ## +AC_LIBLTDL_CONVENIENCE([../libltdl]) +AC_SUBST([INCLTDL]) +AC_SUBST([LIBLTDL]) + +AC_LIBTOOL_WIN32_DLL +AC_LIBTOOL_DLOPEN +AM_PROG_LIBTOOL +AC_SUBST(LIBTOOL_DEPS) + +if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then + STATIC=-static +else + STATIC= +fi +AC_SUBST([STATIC]) + + +## ---------------------------- ## +## C headers required by mdemo. ## +## ---------------------------- ## +AC_CHECK_HEADERS([math.h]) + + +## ---------------------------- ## +## Libraries required by cdemo. ## +## ---------------------------- ## +AC_CHECK_LIBM +AC_SUBST([LIBM]) + + +## -------- ## +## Outputs. ## +## -------- ## +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/mdemo/foo.h b/mdemo/foo.h index 48dc9127e..be28c770b 100644 --- a/mdemo/foo.h +++ b/mdemo/foo.h @@ -26,4 +26,6 @@ USA. */ #define HELLO_RET 0xe110 #define FOO_RET 0xf00 +extern void sub(); + #endif /* !_FOO_H_ */ diff --git a/mdemo/foo1.c b/mdemo/foo1.c index a6a28dd2c..e09c5f8da 100644 --- a/mdemo/foo1.c +++ b/mdemo/foo1.c @@ -36,6 +36,7 @@ int nothing; int _foo1_helper() { + sub(); return FOO_RET; } diff --git a/mdemo/foo2.c b/mdemo/foo2.c index a747d4c69..443994d6d 100644 --- a/mdemo/foo2.c +++ b/mdemo/foo2.c @@ -36,6 +36,7 @@ int nothing; int _foo2_helper() { + sub(); return FOO_RET; } diff --git a/mdemo/main.c b/mdemo/main.c index afe02a2d1..312fd10ed 100644 --- a/mdemo/main.c +++ b/mdemo/main.c @@ -1,5 +1,5 @@ /* main.c -- mdemo test program - Copyright (C) 1998-1999 Free Software Foundation, Inc. + Copyright (C) 1998-2000 Free Software Foundation, Inc. Originally by Thomas Tanner This file is part of GNU Libtool. @@ -27,6 +27,7 @@ test_dl (filename) char *filename; { lt_dlhandle handle; + const lt_dlinfo *info; int (*pfoo1)() = 0; int (*pfoo2)() = 0; int (*phello)() = 0; @@ -39,11 +40,21 @@ test_dl (filename) fprintf (stderr, "error was: %s\n", lt_dlerror()); return 1; } - phello = (int(*)())lt_dlsym(handle, "hello"); - pfoo1 = (int(*)())lt_dlsym(handle, "foo1"); - pfoo2 = (int(*)())lt_dlsym(handle, "foo2"); - pnothing = (int*)lt_dlsym(handle, "nothing"); + info = lt_dlgetinfo(handle); + if (!info) { + fprintf (stderr, "can't get module info: %s\n", lt_dlerror()); + return 1; + } + if (info->name) { + printf ("module name: %s\n", info->name); + } else { + printf ("module is not a libtool module\n"); + } + printf ("module filename: %s\n", info->filename); + printf ("module reference count: %i\n", info->ref_count); + + phello = (int(*)())lt_dlsym(handle, "hello"); if (phello) { int value = (*phello) (); @@ -55,18 +66,22 @@ test_dl (filename) else { fprintf (stderr, "did not find the `hello' function\n"); + fprintf (stderr, "error was: %s\n", lt_dlerror()); ret = 1; } + pnothing = (int*)lt_dlsym(handle, "nothing"); /* Try assigning to the nothing variable. */ if (pnothing) *pnothing = 1; else { fprintf (stderr, "did not find the `nothing' variable\n"); + fprintf (stderr, "error was: %s\n", lt_dlerror()); ret = 1; } + pfoo1 = (int(*)())lt_dlsym(handle, "foo1"); /* Just call the functions and check return values. */ if (pfoo1) { @@ -75,18 +90,21 @@ test_dl (filename) else ret = 1; } - else if (pfoo2) - { - if ((*pfoo2) () == FOO_RET) - printf("foo2 is ok!\n"); - else ret = 1; - } - else - { - fprintf (stderr, "did not find the `foo' function\n"); - ret = 1; - } - + else { + pfoo2 = (int(*)())lt_dlsym(handle, "foo2"); + if (pfoo2) + { + if ((*pfoo2) () == FOO_RET) + printf("foo2 is ok!\n"); + else ret = 1; + } + else + { + fprintf (stderr, "did not find any of the `foo' functions\n"); + fprintf (stderr, "error was: %s\n", lt_dlerror()); + ret = 1; + } + } lt_dlclose(handle); return ret; } @@ -113,9 +131,8 @@ test_dlself () fprintf (stderr, "error was: %s\n", lt_dlerror()); return 1; } - pmyfunc = (int(*)())lt_dlsym(handle, "myfunc"); - pmyvar = (int*)lt_dlsym(handle, "myvar"); + pmyfunc = (int(*)())lt_dlsym(handle, "myfunc"); if (pmyfunc) { int value = (*pmyfunc) (); @@ -127,15 +144,18 @@ test_dlself () else { fprintf (stderr, "did not find the `myfunc' function\n"); + fprintf (stderr, "error was: %s\n", lt_dlerror()); ret = 1; } + pmyvar = (int*)lt_dlsym(handle, "myvar"); /* Try assigning to the variable. */ if (pmyvar) *pmyvar = 1; else { fprintf (stderr, "did not find the `myvar' variable\n"); + fprintf (stderr, "error was: %s\n", lt_dlerror()); ret = 1; } diff --git a/pdemo/configure.ac b/pdemo/configure.ac new file mode 100644 index 000000000..89bfbe9ad --- /dev/null +++ b/pdemo/configure.ac @@ -0,0 +1,77 @@ +## Process this file with autoconf to create configure. -*- autoconf -*- +# Copyright 2001 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA + +AC_PREREQ(2.50) + + +## ------------------------ ## +## Autoconf initialisation. ## +## ------------------------ ## +AC_INIT([pdemo], [0.1], [bug-libtool@gnu.org]) +AC_CONFIG_SRCDIR([longer_file_name_hello.c]) + + +## ------------------------ ## +## Automake Initialisation. ## +## ------------------------ ## +AM_INIT_AUTOMAKE(hell,1.0) + + +## ------------------ ## +## C compiler checks. ## +## ------------------ ## +AC_PROG_CC +AC_C_CONST + + +## ----------------------- ## +## Libtool initialisation. ## +## ----------------------- ## +AC_LIBTOOL_DLOPEN +AM_PROG_LIBTOOL +AC_SUBST([LIBTOOL_DEPS]) + +if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then + STATIC=-static +else + STATIC= +fi +AC_SUBST([STATIC]) + +AM_CONDITIONAL([BINARY_HELLDL], + [grep '^global_symbol_pipe=..*$' ./libtool >/dev/null]) + + +## ---------------------------- ## +## C headers required by cdemo. ## +## ---------------------------- ## +AC_CHECK_HEADERS([string.h math.h]) + + +## ---------------------------- ## +## Libraries required by cdemo. ## +## ---------------------------- ## +AC_CHECK_LIBM +AC_SUBST([LIBM]) + + +## -------- ## +## Outputs. ## +## -------- ## +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/tagdemo/configure.ac b/tagdemo/configure.ac new file mode 100644 index 000000000..c4f50d739 --- /dev/null +++ b/tagdemo/configure.ac @@ -0,0 +1,86 @@ +## Process this file with autoconf to create configure. -*- autoconf -*- +# Copyright 2001 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA + +AC_PREREQ(2.50) + + +## ------------------------ ## +## Autoconf initialisation. ## +## ------------------------ ## +AC_INIT([tagdemo], [0.1], [bug-libtool@gnu.org]) +AC_CONFIG_SRCDIR([foo.cpp]) + +AC_CANONICAL_TARGET + + +## ------------------------ ## +## Automake Initialisation. ## +## ------------------------ ## +AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION) + + +## ---------------- ## +## Compiler checks. ## +## ---------------- ## +AC_PROG_CC +AC_PROG_CPP +AC_PROG_CC_C_O + +AC_PROG_CXX +AC_PROG_CXXCPP + +# As of the writing of this demo, GNU Autoconf's AC_OBJEXT and +# AC_EXEEXT macros only works for C compilers! +# Libtool's setup macro calls AC_OBJEXT and AC_EXEEXT without setting +# the test language to C. We do it before any libtool setup macros are +# called so that the proper values are cached beforehand. We also do +# it before any linker flags (LDFLAGS) are set so that C++ specific +# ones don't break the tests. +AC_LANG_PUSH([C]) +AC_OBJEXT +AC_EXEEXT +AC_LANG_POP + + +## ----------------------- ## +## Libtool initialisation. ## +## ----------------------- ## + +# Set the test language to C++. +AC_LANG([C++]) +AM_PROG_LIBTOOL + + +## ---------------------------- ## +## C headers required by cdemo. ## +## ---------------------------- ## +AC_CHECK_HEADERS([math.h]) + + +## ---------------------------- ## +## Libraries required by cdemo. ## +## ---------------------------- ## +AC_CHECK_LIBM +AC_SUBST([LIBM]) + + +## -------- ## +## Outputs. ## +## -------- ## +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/tests/Makefile.am b/tests/Makefile.am index 36fde5d2a..743530c08 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -40,7 +40,6 @@ COMMON_TESTS = \ quote.test sh.test suffix.test pdemo-conf.test \ pdemo-make.test pdemo-exec.test pdemo-inst.test - if HAVE_CXX TESTS = $(COMMON_TESTS) $(CXX_TESTS) else @@ -52,16 +51,17 @@ demo-conf.test: $(top_builddir)/libtool $(top_builddir)/libtool: cd $(top_builddir) && $(MAKE) all -# We should export these variables when we run ltconfig. +# We should export these variables when we build the libtool script. CFLAGS = @CFLAGS@ -CPPLAGS = @CPPFLAGS@ +CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ # Be sure to reexport important environment variables. TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \ CPPFLAGS="$(CPPFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \ - LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" + LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \ + OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" EXTRA_DIST = defs $(COMMON_TESTS) $(CXX_TESTS) @@ -74,4 +74,3 @@ clean-local: -test -f ../mdemo/Makefile && cd ../mdemo && $(MAKE) distclean -test -f ../tagdemo/Makefile && cd ../tagdemo && $(MAKE) distclean rm -rf _inst - diff --git a/tests/assign.test b/tests/assign.test index fa78f4383..9de7f8234 100755 --- a/tests/assign.test +++ b/tests/assign.test @@ -12,7 +12,7 @@ fi . $srcdir/defs || exit 1 # Check that test -e isn't used in our portable shell scripts. -if egrep -n '[^ ]=[^ ].*(break|continue)' $srcdir/../ltconfig $srcdir/../ltmain.sh; then +if egrep -n '[^ ]=[^ ].*(break|continue)' $srcdir/../ltmain.sh; then echo "cannot use \`break' or \`continue' on the same line as an assignment" exit 1 fi diff --git a/tests/depdemo-unst.test b/tests/depdemo-unst.test index 5befeb8a3..34d54231b 100755 --- a/tests/depdemo-unst.test +++ b/tests/depdemo-unst.test @@ -26,6 +26,7 @@ leftovers=`find $prefix ! -type d ! -name '.*' -print` if test -n "$leftovers"; then echo "= Leftover after make uninstall:" ls -l $leftovers + ls -l $leftovers > ~/devel/savannah/arse exit 1 fi diff --git a/tests/dryrun.test b/tests/dryrun.test index 5a8d20f14..c1830fd71 100755 --- a/tests/dryrun.test +++ b/tests/dryrun.test @@ -42,17 +42,18 @@ mv libtool $objdir/libtool mv $objdir/libtool.new libtool # main.o is not compiled with libtool, but it depends on it, so make -# sure it is up-to-date -$make main.o || exit 1 +# sure it is up-to-date. libfoo2.la is linked with libsub.la, so make +# sure it exists, otherwise libtool will complain. +$make main.$OBJEXT || exit 1 echo "= Making object files in ../mdemo (dry run)" ls -l . $objdir > $before -force_dry_run=yes $make foo1.lo foo2.lo || exit $? +force_dry_run=yes $make foo1.lo foo2.lo sub.lo || exit $? ls -l . $objdir > $after cmp $before $after > /dev/null || exit 1 # Now really make them echo "= Making object files in ../mdemo" -$make foo1.lo foo2.lo || exit 1 +$make foo1.lo foo2.lo libsub.la || exit 1 echo "= Making libraries in ../mdemo (dry run)" ls -l . $objdir > $before @@ -65,12 +66,12 @@ $make foo1.la libfoo2.la || exit 1 echo "= Making programs in ../mdemo (dry run)" ls -l . $objdir > $before -force_dry_run=yes $make mdemo mdemo.static 1>&2 || exit $? +force_dry_run=yes $make mdemo$EXEEXT mdemo.static 1>&2 || exit $? ls -l . $objdir > $after cmp $before $after > /dev/null || exit 1 # Now really make them echo "= Making programs in ../mdemo" -$make mdemo mdemo.static || exit 1 +$make mdemo$EXEEXT mdemo.static || exit 1 echo "= Running $make install in ../mdemo (dry run)" # Libtool does not create these directories @@ -88,7 +89,7 @@ $make install || exit 1 echo "= Running $make uninstall in ../mdemo (dry run)" # Libtool does not uninstall the programs, remove them first -rm -f $prefix/bin/mdemo $prefix/bin/mdemo.static +rm -f $prefix/bin/mdemo$EXEEXT $prefix/bin/mdemo.static ls -l . $objdir > $before ls -lR $prefix >> $before force_dry_run=yes $make uninstall 1>&2 || exit $? diff --git a/tests/hardcode.test b/tests/hardcode.test index d780ab612..0da71bd20 100755 --- a/tests/hardcode.test +++ b/tests/hardcode.test @@ -40,7 +40,7 @@ fi echo "= Running $make hardcode in ../demo" $make hardcode || exit 1 -echo "= Finding ltconfig's guesses at hardcoding values" +echo "= Finding libtool.m4's guesses at hardcoding values" status=0 hardcode_direct=NONE hardcode_minus_L=NONE diff --git a/tests/quote.test b/tests/quote.test index 6866281ff..e77317a61 100755 --- a/tests/quote.test +++ b/tests/quote.test @@ -36,7 +36,7 @@ else # This shell has a builtin print -r that does the trick. echo='print -r' elif test -f /bin/ksh && test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running ltconfig again with it. + # If we have ksh, try running $0 again with it. CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"} diff --git a/tests/sh.test b/tests/sh.test index 41290b604..8d3997538 100755 --- a/tests/sh.test +++ b/tests/sh.test @@ -12,7 +12,7 @@ fi # Check all the "portable" shell scripts. status=0 -scripts="$srcdir/../ltconfig $srcdir/../ltmain.sh" +scripts="$srcdir/../ltmain.sh" # Check for bad binary operators. if egrep -n -e "if[ ]+[\"']?\\$.*(=|-[lg][te]|-eq|-ne)" $scripts; then @@ -32,14 +32,25 @@ if egrep -n -e 'if[ ]+\[' $scripts; then status=1 fi +if egrep -n -e 'test[ ]+(![ ])?(-.[ ]+)?"?[.,_x]' $scripts; then + echo "use \`test \"X...\"' instead of \`test \"x...\"'" + status=1 +fi + # Check for using test X... instead of test "X... -if egrep -n -e 'test[ ]+X' $scripts; then +if egrep -n -e 'test[ ]+(![ ])?(-.[ ]+)?X' $scripts; then echo "use \`test \"X...\"' instead of \`test X'" status=1 fi +# Check for using test $... instead of test "$... +if egrep -n -e 'test[ ]+(![ ])?(-.[ ]+)?X?\$' $scripts; then + echo "use \`test \"\$...\"' instead of \`test \$'" + status=1 +fi + # Never use test -e. -if egrep -n -e 'test[ ]+-e' $scripts; then +if egrep -n -e 'test[ ]+(![ ])?-e' $scripts; then echo "use \`test -f' instead of \`test -e'" status=1 fi