+1999-03-20 Thomas Tanner <tanner@gmx.de>
+
+ * use the same header in all configure.in's and Makefile.am's
+ * TODO: all internal variables and macros are now documented
+ * demo/Makefile.am: use $(LIBS) instead of -lm
+ * doc/libtool.texi: documented thread_safe_flag_spec,
+ renamed all AM_ENABLE/DISABLE_* macros to AC_*,
+ documented AC_DISABLE_FAST_INSTALL and AC_LIBTOOL_DLOPEN
+ documentation for -module updated
+ * ltmain.in: bugfix: "-dlopen self [-all]-static" wouldn't use
+ dlopen_self_static, automatically enable -export-dynamic when
+ using "-dlopen self", always make run-paths absolute,
+ ignore -lc only on platforms that don't have such a library,
+ don't generate an installable pseudo-library for convenience
+ libraries, bugfix: export_symbols would be removed immediately
+ before it is be used
+
1999-03-19 Alexandre Oliva <oliva@dcc.unicamp.br>
* ltconfig.in (sunos4*, with_gnu_ld, hardcode_minus_L): remove, we
-## Process Makefile.am with automake to create Makefile.in. -*-Makefile-*-
-## Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = 1.3e gnits readme-alpha
* Lists of exported symbols should be stored in the pseudo library
so that the size of lt_preloaded_symbols can be reduced.
-* Documentation:
-
-- AC_PROG_LIBTOOL, AC_ENABLE/DISABLE_SHARED/STATIC/FAST_INSTALL,
- AC_LIBTOOL_DLOPEN, AC_LIBLTDL_CONVENIENCE/INSTALLABLE are not documented
-
-- Purpose and usage of convenience libraries must be better documented
-
-- some new internal variables are not documented yet.
+* Purpose and usage of convenience libraries must be better documented
In the future:
**************
-# A brief demonstration of Libtool modules. -*-Makefile-*-
-#
+## Process this file with automake to produce Makefile.in
+
AUTOMAKE_OPTIONS = no-dependencies foreign
EXTRA_DIST = acinclude.m4
-dnl Initialize the cdemo package.
+dnl Process this file with autoconf to create configure.
+
AC_INIT(main.c)
AM_INIT_AUTOMAKE(cdemo,0.1)
-# A brief demonstration of using Automake with Libtool. -*-Makefile-*-
-#
+## Process this file with automake to produce Makefile.in
+
AUTOMAKE_OPTIONS = no-dependencies foreign
EXTRA_DIST = $(TESTS) acinclude.m4
eval `egrep -e '^(hardcode_.*|wl)=' libtool`; \
libdir=$(libdir); \
flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \
- echo "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib -lm $$flag || echo unsupported > $@"; \
- eval "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib -lm $$flag || echo unsupported > $@"
+ echo "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib $(LIBS) $$flag || echo unsupported > $@"; \
+ eval "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib $(LIBS) $$flag || echo unsupported > $@"
hc-libflag: $(hell_OBJECTS) $(hell_DEPENDENCIES) $(libdir)/libhello.la
@eval `egrep -e '^(hardcode_.*|wl)=' libtool`; \
echo "echo unsupported > $@"; \
echo unsupported > $@ || status="$$?"; \
else \
- echo "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$flag -L$(libdir) -lhello -lm"; \
- $(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$flag -L$(libdir) -lhello -lm || status="$$?"; \
+ echo "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$flag -L$(libdir) -lhello $(LIBS)"; \
+ $(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$flag -L$(libdir) -lhello $(LIBS) || status="$$?"; \
fi; \
exit $$status
@eval `egrep -e '^(shlibpath_var|hardcode_.*|wl)=' libtool`; \
libdir=$(libdir); \
flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \
- echo "$$shlibpath_var=./$(objdir) $(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -lhello -lm $$flag || echo unsupported > $@"; \
- eval "$$shlibpath_var=./$(objdir) $(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -lhello -lm $$flag || echo unsupported > $@"
+ echo "$$shlibpath_var=./$(objdir) $(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -lhello $(LIBS) $$flag || echo unsupported > $@"; \
+ eval "$$shlibpath_var=./$(objdir) $(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -lhello $(LIBS) $$flag || echo unsupported > $@"
hc-minusL: $(hell_OBJECTS) $(hell_DEPENDENCIES)
@rm -f hc-minusL
@eval `egrep -e '^(hardcode_.*|wl)=' libtool`; \
libdir=$(libdir); \
flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \
- echo "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello -lm $$flag || echo unsupported > $@"; \
- eval "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello -lm $$flag || echo unsupported > $@"
+ echo "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello $(LIBS) $$flag || echo unsupported > $@"; \
+ eval "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello $(LIBS) $$flag || echo unsupported > $@"
$(OBJECTS): libtool
libtool: $(LIBTOOL_DEPS)
-dnl Initialize the hell package.
+dnl Process this file with autoconf to create configure.
+
AC_INIT(hello.c)
AM_INIT_AUTOMAKE(hell,1.0)
-# A brief demonstration of inter-library dependencies
-#
+## Process this file with automake to produce Makefile.in
+
AUTOMAKE_OPTIONS = no-dependencies foreign
SUBDIRS = l1 l2 l3 l4
-dnl Initialize the depdemo package.
+dnl Process this file with autoconf to create configure.
+
AC_INIT(main.c)
AM_INIT_AUTOMAKE(depdemo,0.1)
-## Process Makefile.am with automake to create Makefile.in. -*-Makefile-*-
-##
-## Copyright (C) 1996 Free Software Foundation, Inc.
-## This Makefile.am is free software; the Free Software Foundation
-## gives unlimited permission to copy, distribute and modify it.
-##
-## Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>
+## Process this file with automake to produce Makefile.in
+
AUTOMAKE_OPTIONS = gnits
info_TEXINFOS = libtool.texi
libtool_TEXINFOS = PLATFORMS
@item -module
Creates a library that can be dlopenend (@pxref{Dlopened modules}).
-This option doesn't work for programs and must not be used
-together with @samp{-export-symbols}.
-It enables the option @samp{-export-dynamic} automatically.
+This option doesn't work for programs.
Module names don't need to be prefixed with 'lib'.
In order to prevent name clashes, however, 'libname' and 'name'
must not be used at the same time in your package.
By default, this macro turns on shared libraries if they are available,
and also enables static libraries if they don't conflict with the shared
libraries. You can modify these defaults by calling either the
-@code{AM_DISABLE_SHARED} or @code{AM_DISABLE_STATIC} macros:
+@code{AC_DISABLE_SHARED} or @code{AC_DISABLE_STATIC} macros:
@example
# Turn off shared libraries during beta-testing, since they
# make the build process take too long.
-AM_DISABLE_SHARED
+AC_DISABLE_SHARED
AM_PROG_LIBTOOL
@end example
comma-separated @var{pkgs} list, and every other package with
@samp{--disable-shared}. The @samp{--enable-static=@var{pkgs}} flag
behaves similarly, but it uses @samp{--enable-static} and
-@samp{--disable-static}.
+@samp{--disable-static}. The same applies to the
+@samp{--enable-fast-install=@var{pkgs}} flag, which uses
+@samp{--enable-fast-install} and @samp{--disable-fast-install}.
The package name @samp{default} matches any packages which have not set
their name in the @code{PACKAGE} environment variable.
@end defmac
-@defmac AM_DISABLE_SHARED
+@defmac AC_LIBTOOL_DLOPEN
+Enable checking for dlopen support. This macro should be used if
+the package makes use of the -dlopen and -dlpreopen flags, otherwise
+libtool will assume that the system does not support dlopening.
+The macro must be called *before* @code{AM_PROG_LIBTOOL}.
+@end defmac
+
+@defmac AC_DISABLE_FAST_INSTALL
+Change the default behaviour for @code{AM_PROG_LIBTOOL} to disable
+optimization for fast installation. The user may still override
+this default by specifying @samp{--enable-fast-install}.
+@end defmac
+
+@defmac AC_DISABLE_SHARED
+@defmacx AM_DISABLE_SHARED
Change the default behaviour for @code{AM_PROG_LIBTOOL} to disable
shared libraries. The user may still override this default by
specifying @samp{--enable-shared}.
@end defmac
-@defmac AM_DISABLE_STATIC
+@defmac AC_DISABLE_STATIC
+@defmacx AM_DISABLE_STATIC
Change the default behaviour for @code{AM_PROG_LIBTOOL} to disable
static libraries. The user may still override this default by
specifying @samp{--enable-static}.
@defvar always_export_symbols
Whether libtool should automatically generate a list of exported symbols
using @var{export_symbols_cmds} before linking an archive.
-Set to @samp{yes} or @samp{no}. Default is @samp{no}
+Set to @samp{yes} or @samp{no}. Default is @samp{no}.
@end defvar
@defvar archive_cmds
as @code{-L} also augment the search path.
@end defvar
+@defvar thread_safe_flag_spec
+Linker flag (passed through the C compiler) used to generate thread-safe
+libraries.
+@end defvar
+
@defvar version_type
The library version numbering type. One of @samp{libtool},
@samp{linux}, @samp{osf}, @samp{sunos}, or @samp{none}.
-# A brief demonstration of using Automake with Libtool. -*-Makefile-*-
-#
+## Process this file with automake to produce Makefile.in
+
AUTOMAKE_OPTIONS = no-dependencies foreign
if INSTALL_LTDL
dnl Process this file with autoconf to create configure.
-dnl Initialize the libltdl package.
+
AC_INIT(ltdl.c)
if test -z "$enable_ltdl_install$enable_ltdl_convenience"; then
do
case "$arg" in
-all-static | -static)
- if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ if test "X$arg" = "X-all-static"; then
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ else
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
fi
build_libtool_libs=no
build_old_libs=yes
dlself=yes
elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
dlself=yes
+ else
+ export_dynamic=yes
fi
prev=
continue
;;
*)
- dlprefiles="$dlprefiles $arg"
- test "$prev" = dlfiles && dlfiles="$dlfiles $arg"
+ if test "$prev" = dlfiles; then
+ dlfiles="$dlfiles $arg"
+ else
+ dlprefiles="$dlprefiles $arg"
+ fi
prev=
;;
esac
prev=
continue
;;
- rpath)
- rpath="$rpath $arg"
- prev=
- continue
- ;;
- xrpath)
- xrpath="$xrpath $arg"
+ rpath | xrpath)
+ # We need an absolute path.
+ case "$arg" in
+ /* | [A-Za-z]:[/\\]*) ;;
+ *)
+ absdir=`cd "$arg" && pwd`
+ if test -z "$absdir"; then
+ $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
+ exit 1
+ fi
+ arg="$absdir"
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) rpath="$rpath $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) xrpath="$xrpath $arg" ;;
+ esac
+ fi
prev=
continue
;;
if test -n "$link_static_flag"; then
compile_command="$compile_command $link_static_flag"
finalize_command="$finalize_command $link_static_flag"
- dlopen_self=$dlopen_self_static
fi
continue
;;
;;
-export-dynamic)
- if test "$export_dynamic" != yes; then
- export_dynamic=yes
- if test -n "$export_dynamic_flag_spec"; then
- eval arg=\"$export_dynamic_flag_spec\"
- else
- arg=
- fi
- fi
+ export_dynamic=yes
+ continue
;;
-export-symbols | -export-symbols-regex)
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
- $echo "$modename: cannot have more than one -exported-symbols"
+ $echo "$modename: not more than one -exported-symbols argument allowed"
exit 1
fi
- if test "$arg" = "-export-symbols"; then
+ if test "X$arg" = "X-export-symbols"; then
prev=expsyms
else
prev=expsyms_regex
;;
-L*)
- dir=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'`
+ dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
case "$dir" in
/* | [A-Za-z]:[/\\]*)
# Add the corresponding hardcode_libdir_flag, if it is not identical.
;;
-l*)
- if test "$arg" = "-lm"; then
+ if test "$arg" = "-lc"; then
+ case "$host" in
+ *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
+ # These systems don't actually have c library (as such)
+ continue
+ ;;
+ esac
+ elif test "$arg" = "-lm"; then
case "$host" in
*-*-cygwin* | *-*-beos*)
- # Ignore -lm on Cygwin and BeOS
+ # These systems don't actually have math library (as such)
continue
;;
- esac
- elif test "$arg" = "-lc"; then
- # Always ignore -lc
- continue
+ esac
fi
deplibs="$deplibs $arg"
;;
-module)
- if test "$module" != yes; then
- module=yes
- if test -n "$export_dynamic_flag_spec"; then
- eval arg=\"$export_dynamic_flag_spec\"
- else
- arg=
- fi
- fi
+ module=yes
+ continue
;;
-
+
-no-undefined)
allow_undefined=no
continue
;;
-R*)
- xrpath="$xrpath "`$echo "X$arg" | $Xsed -e 's/^-R//'`
+ dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
+ # We need an absolute path.
+ case "$dir" in
+ /* | [A-Za-z]:[/\\]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
+ exit 1
+ fi
+ dir="$absdir"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
continue
;;
if test -z "$pic_flag" && test -n "$link_static_flag"; then
compile_command="$compile_command $link_static_flag"
finalize_command="$finalize_command $link_static_flag"
- dlopen_self=$dlopen_self_static
fi
continue
;;
exit 1
fi
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ fi
+
oldlibs=
# calculate the name of the file, without its directory
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
fi
- if test -n "$export_symbols"; then
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
fi
output_objdir="$output_objdir/$objdir"
fi
- # All the library-specific variables (install_libdir is set above).
- library_names=
- old_library=
- dlname=
-
if test -n "$objs"; then
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
exit 1
fi
done
fi
- deplibs=$newdeplibs
;;
file_magic*)
set dummy $deplibs_check_method
fi
done # Gone through all deplibs.
;;
- none | unknown | *) newdeplibs=""
+ none | unknown | *)
+ newdeplibs=""
if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
-e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
grep . >/dev/null; then
else
build_libtool_libs=no
fi
- dlname=
- library_names=
else
echo "*** The inter-library dependencies that have been dropped here will be"
echo "*** automatically added whenever a program is linked with this library"
echo "*** or is declared to -dlopen it."
fi
fi
+ # Done checking deplibs!
+ deplibs=$newdeplibs
fi
- # test again, we may have decided not to build it any more
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
if test "$build_libtool_libs" = yes; then
- deplibs=$newdeplibs
- # Done checking deplibs!
-
# Get the real and link names of the library.
eval library_names=\"$library_names_spec\"
set dummy $library_names
fi
fi
- if test "$dlself" = yes && test "$export_dynamic" = no; then
- $echo "$modename: error: \`-dlopen self' requires \`-export-dynamic'" 1>&2
- exit 1
- fi
-
if test -n "$rpath$xrpath"; then
# If the user specified any rpath flags, then add them.
for libdir in $rpath $xrpath; do
$run $rm $export_symbols
$run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
else
- $run $rm $export_symbols
$run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$objdir/$output.exp"'
$run eval 'grep -f "$objdir/$output.exp" < "$nlist" > "$nlist"T'
$run eval 'mv "$nlist"T "$nlist"'
fi
fi
- # Delete the old output file.
+ # Delete the old output files.
$run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
$show "$link_command"
# Only create the output if not a dry run.
if test -z "$run"; then
- $echo > $output "\
+ for installed in no yes; do
+ if test "$installed" = yes; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output="$output_objdir/$outputname"i
+ fi
+ $rm $output
+ $echo > $output "\
# $output - a libtool library file
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
revision=$revision
# Is this an already installed library?
-installed=no
+installed=$installed
# Directory that this library needs to be installed in:
libdir='$install_libdir'\
"
-
- $rm "$output_objdir/$outputname"i
- sed 's/^installed=no$/installed=yes/' \
- < "$output" > "$output_objdir/$outputname"i || exit 1
+ done
fi
# Do a symbolic link so that the libtool archive can be found in
-# A brief demonstration of Libtool modules. -*-Makefile-*-
-#
+## Process this file with automake to produce Makefile.in
+
AUTOMAKE_OPTIONS = no-dependencies foreign
INCLUDES = -I$(srcdir)/../libltdl
-dnl Initialize the mdemo package.
+dnl Process this file with autoconf to create configure.
+
AC_INIT(main.c)
AM_INIT_AUTOMAKE(mdemo,0.1)
-## Process this file with automake to create Makefile.in -*-Makefile-*-
+## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = gnits