| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 | #!/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/>.# Test for conditional libtool libraries.# This combines two examples from the manual.required='cc libtoolize'. test-init.shcat >>configure.ac <<'END'AM_CONDITIONAL([WANT_LIBFOO], [true])AM_CONDITIONAL([WANT_LIBBAR], [false])AC_SUBST([WANTEDLIBS], ['lib1foo.la lib1bar.la'])AC_PROG_CCAM_PROG_ARAC_PROG_LIBTOOLAC_OUTPUTENDcat >Makefile.am <<'END'EXTRA_LTLIBRARIES = lib1foo.la lib1bar.la lib3bar.lalib_LTLIBRARIES = $(WANTEDLIBS)lib1foo_la_SOURCES = foo.clib1foo_la_LDFLAGS = -rpath '$(libdir)'lib1bar_la_SOURCES = bar.clib1bar_la_LDFLAGS = -rpath '$(libdir)'lib3bar_la_SOURCES = bar.cif WANT_LIBFOOlib_LTLIBRARIES += lib2foo.lacheck_LTLIBRARIES = lib3foo.laendifif WANT_LIBBARlib_LTLIBRARIES += lib2bar.laendiflib2foo_la_SOURCES = foo.clib2bar_la_SOURCES = bar.clib3foo_la_SOURCES = foo.cENDecho 'int one () { return 1; }' >foo.cecho 'int two () { return 2; }' >bar.cmkdir emptylibtoolize$ACLOCAL$AUTOCONF$AUTOMAKE --add-missingcwd=$(pwd) || fatal_ "getting current working directory"# Install libraries in lib/, and the rest in empty/.# (in fact there is no "rest", so as the name imply empty/ is# expected to remain empty)../configure --prefix="$cwd/empty" --libdir="$cwd/lib"$MAKEtest -f lib1foo.latest -f lib1bar.latest -f lib2foo.latest ! -e lib2bar.latest ! -e lib3foo.latest ! -e lib3bar.la$MAKE checktest ! -e lib2bar.latest -f lib3foo.latest ! -e lib3bar.la$MAKE installtest -f lib/lib1foo.latest -f lib/lib1bar.latest -f lib/lib2foo.latest ! -e lib/lib3foo.lafind empty -type f -print > empty.lsttest -s empty.lst && { cat empty.lst; exit 1; }$MAKE uninstallfind lib -type f -print > lib.lsttest -s lib.lst && { cat lib.lst; exit 1; }test -f lib1foo.latest -f lib1bar.latest -f lib2foo.latest -f lib3foo.la$MAKE cleantest ! -e lib1foo.latest ! -e lib1bar.latest ! -e lib2foo.latest ! -e lib3foo.la:
 |