| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 | #! /bin/sh# Copyright (C) 2003-2017 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'. test-init.shmldir=$am_top_srcdir/contrib/multilibmkdir m4cp "$mldir"/config-ml.in "$mldir"/symlink-tree .cp "$mldir"/multi.m4 m4ACLOCAL_PATH=${ACLOCAL_PATH+"$ACLOCAL_PATH:"}$(pwd)/m4export ACLOCAL_PATHcat >configure.ac <<'END'AC_INIT([multlib], [1.0])AC_CONFIG_SRCDIR(libfoo/foo.c)AC_CONFIG_AUX_DIR(.)AM_INIT_AUTOMAKEAC_CONFIG_FILES([Makefile])AC_CONFIG_SUBDIRS(libfoo)AC_CONFIG_SUBDIRS(libbar)AC_OUTPUTENDcat >mycc <<'END'#! /bin/shcase ${1+"$@"} in *-print-multi-lib*)  echo ".;"  echo "debug;@g"  exit 0 ;;esacgcc ${1+"$@"}ENDchmod +x myccPATH=$(pwd)$PATH_SEPARATOR$PATH; export PATHcat >Makefile.am <<'EOF'SUBDIRS = @subdirs@EXTRA_DIST = config-ml.in symlink-treecheck-all:	test -f debug/libfoo/libfoo.a	test -f debug/libbar/libbar.a	test -f libfoo/libfoo.a	test -f libbar/libbar.aEOF# libfoo tests multilib supports when there are no subdirectories# libbar tests multilib supports when there are subdirectoriesmkdir libfoocp "$mldir"/multilib.am libfoo/cat >libfoo/configure.ac <<'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_AUTOMAKEAC_PROG_CCAM_PROG_ARAC_PROG_RANLIBAM_ENABLE_MULTILIB(Makefile,[..])AC_CONFIG_FILES([Makefile])AC_OUTPUTENDcat >libfoo/Makefile.am <<'END'noinst_LIBRARIES = libfoo.alibfoo_a_SOURCES = foo.cinclude $(top_srcdir)/multilib.amEND: > libfoo/foo.cmkdir libbarcp "$mldir"/multilib.am libbar/cat >libbar/configure.ac <<'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_AUTOMAKEAC_PROG_CCAM_PROG_ARAC_PROG_RANLIBAM_ENABLE_MULTILIB(Makefile,[..])AC_CONFIG_FILES([Makefile sub/Makefile])AC_OUTPUTENDcat >libbar/Makefile.am <<'END'SUBDIRS = subnoinst_LIBRARIES = libbar.alibbar_a_SOURCES = bar.cinclude $(top_srcdir)/multilib.amENDmkdir libbar/subecho 'include $(top_srcdir)/multilib.am' >libbar/sub/Makefile.am: > libbar/bar.c$ACLOCAL$AUTOCONF$AUTOMAKE --add-missingcd libfoo$ACLOCAL$AUTOCONF$AUTOMAKE --add-missingcd ..cd libbar$ACLOCAL$AUTOCONF$AUTOMAKE --add-missingcd ..# Check VPATH buildsmkdir buildcd build../configure --enable-multilib CC=mycc$MAKEtest -f debug/libfoo/libfoo.atest -f debug/libbar/libbar.atest -f libfoo/libfoo.atest -f libbar/libbar.a$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 checkDISTCHECK_CONFIGURE_FLAGS='--enable-multilib CC=mycc' $MAKE distcheck:
 |