Hash :
c7a6a92e
Author :
Date :
2011-10-21T00:23:34
ar-lib: new 'AM_PROG_AR' macro, triggering the 'ar-lib' script * m4/ar-lib.m4: New macro AM_PROG_AR, which locates an archiver and triggers the auxiliary 'ar-lib' script if needed. * m4/Makefile.am (dist_m4data_DATA): Update. * automake.in ($seen_ar): New variable. (scan_autoconf_traces): Set it. (handle_libraries, handle_ltlibraries): Require AM_PROG_AR for portability. * doc/automake.texi (Public Macros): Mention the new 'AM_PROG_AR' macro. (Subpackages): Add AM_PROG_AR to the example. (A Library): Adjust recommendations for AR given the new AM_PROG_AR macro. * All relevant tests: Adjust to new portability requirements due to the new AM_PROG_AR macro. * tests/ar-lib2.test: New test, checking that AM_PROG_AR triggers install of ar-lib. * tests/ar-lib3.test: New test, checking that lib_LIBRARIES requires AM_PROG_AR. * tests/ar-lib4.test: New test, checking that lib_LTLIBRARIES requires AM_PROG_AR. * tests/ar-lib5a.test: New test, checking that AM_PROG_AR triggers use of ar-lib when the archiver is Microsoft lib. * tests/ar-lib5b.test: New test, checking that AM_PROG_AR triggers use of ar-lib when the archiver is a faked lib. * tests/ar-lib6a.test: New test, checking the ordering of AM_PROG_AR and LT_INIT. * tests/ar-lib6b.test: New test, checking the ordering of AM_PROG_AR and AC_PROG_LIBTOOL. * tests/ar-lib7.test: New test, checking that automake warns if ar-lib is missing. * tests/ar3.test: New test, checking that AR and ARFLAGS may be overridden by the user even if AM_PROG_AR is used. * tests/ar4.test: New test, checking that AM_PROG_AR bails out if it cannot determine the archiver interface. * tests/ar5.test: New test, checking that AM_PROG_AR runs its optional argument if it cannot determine the archiver interface. * tests/defs.in: New required entry 'lib'. * tests/Makefile.am (TESTS): Update. * NEWS: Update. Signed-off-by: Peter Rosin <peda@lysator.liu.se>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
#! /bin/sh
# Copyright (C) 2003, 2004, 2007, 2010 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, see <http://www.gnu.org/licenses/>.
# Check multilib support.
# Based on a test case from Ralf Corsepius.
required='gcc GNUmake'
. ./defs || Exit 1
set -e
cat >configure.in <<'END'
AC_INIT([multlib], [1.0])
AC_CONFIG_SRCDIR(libfoo/foo.c)
AC_CONFIG_AUX_DIR(.)
AM_INIT_AUTOMAKE
AC_CONFIG_FILES([Makefile])
AC_CONFIG_SUBDIRS(libfoo)
AC_CONFIG_SUBDIRS(libbar)
AC_OUTPUT
END
cat >mycc <<'END'
#! /bin/sh
case ${1+"$@"} in
*-print-multi-lib*)
echo ".;"
echo "debug;@g"
exit 0 ;;
esac
gcc ${1+"$@"}
END
chmod +x mycc
PATH=`pwd`$PATH_SEPARATOR$PATH
cat >Makefile.am <<'EOF'
SUBDIRS = @subdirs@
EXTRA_DIST = config-ml.in symlink-tree
EOF
# libfoo tests multilib supports when there are no subdirectories
# libbar tests multilib supports when there are subdirectories
mkdir libfoo
cat >libfoo/configure.in <<'END'
AC_PREREQ(2.57)
AC_INIT(libfoo, 0.1, nobody@localhost)
AC_CONFIG_SRCDIR(foo.c)
# Apparently it doesn't work to have auxdir=.. when
# multilib uses symlinked trees.
AC_CONFIG_AUX_DIR(.)
AM_INIT_AUTOMAKE
AC_PROG_CC
AM_PROG_AR
AC_PROG_RANLIB
AM_ENABLE_MULTILIB(Makefile,[..])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
END
cat >libfoo/Makefile.am <<'END'
noinst_LIBRARIES = libfoo.a
libfoo_a_SOURCES = foo.c
END
: > libfoo/foo.c
mkdir libbar
cat >libbar/configure.in <<'END'
AC_PREREQ(2.57)
AC_INIT(libbar, 0.1, nobody@localhost)
# Apparently it doesn't work to have auxdir=.. when
# multilib uses symlinked trees.
AC_CONFIG_AUX_DIR(.)
AM_INIT_AUTOMAKE
AC_PROG_CC
AM_PROG_AR
AC_PROG_RANLIB
AM_ENABLE_MULTILIB(Makefile,[..])
AC_CONFIG_FILES([Makefile sub/Makefile])
AC_OUTPUT
END
cat >libbar/Makefile.am <<'END'
SUBDIRS = sub
noinst_LIBRARIES = libbar.a
libbar_a_SOURCES = bar.c
END
mkdir libbar/sub
: >libbar/sub/Makefile.am
: > libbar/bar.c
cp "$testsrcdir/../lib/config-ml.in" .
cp "$testsrcdir/../lib/symlink-tree" .
$ACLOCAL
$AUTOCONF
$AUTOMAKE --add-missing
cd libfoo
$ACLOCAL
$AUTOCONF
$AUTOMAKE --add-missing
cd ../libbar
$ACLOCAL
$AUTOCONF
$AUTOMAKE --add-missing
cd ..
# Check VPATH builds
mkdir build
cd build
../configure --enable-multilib CC=mycc
$MAKE
$MAKE install
$MAKE distcleancheck
# Check standard builds.
cd ..
# Why to I have to specify --with-target-subdir?
./configure --enable-multilib --with-target-subdir=. CC=mycc
$MAKE