+2003-04-06 Alexandre Duret-Lutz <adl@gnu.org>
+
+ * lib/am/libs.am (ARFLAGS): Define.
+ * automake.in (handle_libraries): Use `$(ARFLAGS)' instead of
+ hard-coding `cru'.
+ * automake.texi (A Library): Explain how AR, ARFLAGS and RANLIB
+ are used, and how they can be overridden.
+ (Program and Library Variables): Adjust to show `$(ARFLAGS)'
+ instead of `cru'
+ * tests/ar.test: Rewrite to test for AR, ARFLAGS, and RANLIB.
+ * tests/ranlib.test: Delete, obsoleted by ar.test.
+ * tests/Makefile.am (TESTS): Remove ranlib.test.
+ Report from Paul Thomas.
+
2003-04-03 Alexandre Duret-Lutz <adl@gnu.org>
* automake.in (check_trailing_slash): New function (variation on
* Texinfo rules back up and restore info files when makeinfo fails.
+* AR's `cru' flags are now set in a global ARFLAGS variable instead
+ of being hard-coded in each $(AR) invocation, so they can be
+ substituted from configure.ac. This has been requested by people
+ dealing with non-POSIX ar implementations.
+
\f
New in 1.7:
* Autoconf 2.54 is required.
Paul Eggert eggert@twinsun.com
Paul Jarc prj@po.cwru.edu
Paul Martinolich martinol@datasync.com
+Paul Thomas PTHOMAS@novell.com
Pavel Roskin pavel_roskin@geocities.com
Per Bothner bothner@cygnus.com
Per Cederqvist ceder@lysator.liu.se
if (! variable_defined ($xlib . '_AR'))
{
- &define_variable ($xlib . '_AR', '$(AR) cru', $where);
+ &define_variable ($xlib . '_AR', '$(AR) $(ARFLAGS)', $where);
}
# Generate support for conditional object inclusion in
configure-time must be added to the @code{BUILT_SOURCES} variable
(@pxref{Sources}).
+Building a static library is done by compiling all object files, then
+by invoking @code{$(AR) $(ARFLAGS)} followed by the name of the
+library and the list of objects, and finally by calling
+@code{$(RANLIB)} on that library. You should call
+@code{AC_PROG_RANLIB} from your @file{configure.in} to define
+@code{RANLIB} (Automake will complain otherwise). @code{AR} and
+@code{ARFLAGS} default to @code{ar} and @code{cru} respectively; you
+can override these two variables my setting them in your
+@file{Makefile.am}, by @code{AC_SUBST}ing them from your
+@file{configure.in}, or by defining a per-library @code{maude_AR}
+variable (@pxref{Program and Library Variables}).
@node A Shared Library, Program and Library Variables, A Library, Programs
@section Building a Shared Library
e.g., @samp{nodist_EXTRA_maude_SOURCES}.
@item maude_AR
-A static library is created by default by invoking @code{$(AR) cru}
-followed by the name of the library and then the objects being put into
-the library. You can override this by setting the @samp{_AR} variable.
-This is usually used with C++; some C++ compilers require a special
-invocation in order to instantiate all the templates which should go
-into a library. For instance, the SGI C++ compiler likes this variable set
-like so:
+A static library is created by default by invoking @code{$(AR)
+$(ARFLAGS)} followed by the name of the library and then the objects
+being put into the library. You can override this by setting the
+@samp{_AR} variable. This is usually used with C++; some C++
+compilers require a special invocation in order to instantiate all the
+templates which should go into a library. For instance, the SGI C++
+compiler likes this variable set like so:
@example
libmaude_a_AR = $(CXX) -ar -o
@end example
## automake - create Makefile.in from Makefile.am
-## Copyright 1994, 1995, 1996, 1998, 1999, 2001 Free Software Foundation, Inc.
+## Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001, 2002, 2003
+## 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
if %?FIRST%
AR = ar
+ARFLAGS = cru
## For now this is detected when we see AC_PROG_RANLIB
## RANLIB = @RANLIB@
endif %?FIRST%
-@set UPDATED 20 March 2003
-@set UPDATED-MONTH March 2003
+@set UPDATED 6 April 2003
+@set UPDATED-MONTH April 2003
@set EDITION 1.7a
@set VERSION 1.7a
python.test \
python2.test \
python3.test \
-ranlib.test \
recurs.test \
recurs2.test \
remake.test \
python.test \
python2.test \
python3.test \
-ranlib.test \
recurs.test \
recurs2.test \
remake.test \
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-# Test for setting AR in configure.in.
+# Make sure that AR, ARFLAGS, and RANLIB can be substituted from configure.in.
. ./defs || exit 1
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE($me, 1.0)
-AC_PROG_CC
-AC_PROG_RANLIB
-AC_PATH_PROG(AR, arppc)
-AC_CONFIG_FILES(Makefile)
+set -e
+
+cat >> configure.in << 'END'
+AC_SUBST([AR], ['echo it works'])
+AC_SUBST([ARFLAGS], ['>'])
+AC_SUBST([RANLIB], ['echo really works >>'])
+AC_OUTPUT
END
cat > Makefile.am << 'END'
lib_LIBRARIES = libfoo.a
-libfoo_a_SOURCES = maude.c
+libfoo_a_SOURCES =
END
-$ACLOCAL || exit 1
-$AUTOMAKE || exit 1
-
-grep 'AR = ar' Makefile.in && exit 1
-exit 0
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+$MAKE
+grep 'it works' libfoo.a
+grep 'really works' libfoo.a
+++ /dev/null
-#! /bin/sh
-# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc.
-#
-# This file is part of GNU Automake.
-#
-# GNU Automake 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.
-#
-# GNU Automake 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 autoconf; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# Test to make sure AC_PROG_RANLIB can be overridden. Idea from Tatu
-# Ylonen.
-
-. ./defs || exit 1
-
-cat >> configure.in << 'END'
-AC_PROG_CC
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-END
-
-cat > Makefile.am << 'END'
-noinst_LIBRARIES = libjoe.a
-END
-
-: > config.guess
-: > config.sub
-
-$ACLOCAL || exit 1
-$AUTOMAKE
-@set UPDATED 20 March 2003
-@set UPDATED-MONTH March 2003
+@set UPDATED 6 April 2003
+@set UPDATED-MONTH April 2003
@set EDITION 1.7a
@set VERSION 1.7a