maint: Update HACKING
[automake.git] / t / libtool-macros.sh
blob903a25d3f3196d95c1283a822222946d3c44bf73
1 #! /bin/sh
2 # Copyright (C) 2011-2017 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
17 # Try to find the libtool '.m4' files and make them easily accessed
18 # to the test cases requiring them.
19 # See also automake bug#9807.
21 . test-init.sh
23 echo "# Automatically generated by $me." > get.sh
24 echo : >> get.sh
26 # The 'libtoolize' script will look into Makefile.am.
27 echo ACLOCAL_AMFLAGS = -I m4 > Makefile.am
29 if libtoolize --copy --install && test -f m4/libtool.m4; then
30 echo "ACLOCAL_PATH='$(pwd)/m4':\$ACLOCAL_PATH" >> get.sh
31 echo "export ACLOCAL_PATH" >> get.sh
32 else
33 # Libtoolize from libtool < 2.0 didn't support the '--install' option,
34 # but this doesn't mean the user hasn't made the libtool macros
35 # available, e.g., by properly setting ACLOCAL_PATH.
36 rm -rf m4
37 mkdir m4
38 echo AC_PROG_LIBTOOL >> configure.ac
39 # See below for an explanation about the use the of '-Wno-syntax'.
40 if $ACLOCAL -Wno-syntax -I m4 --install && test -f m4/libtool.m4; then
41 : # Libtool macros already accessible by default.
42 else
43 echo "skip_all_ \"couldn't find or get libtool macros\"" >> get.sh
47 . ./get.sh
49 $ACLOCAL --force -I m4 || cat >> get.sh <<'END'
50 # We need to use '-Wno-syntax', since we do not want our test suite
51 # to fail merely because some third-party '.m4' file is underquoted.
52 ACLOCAL="$ACLOCAL -Wno-syntax"
53 END
55 # The file libtoolize might have just copied in the 'm4' subdirectory of
56 # the test directory are going to be needed by other tests, so we must
57 # not remove the test directory.
58 keep_testdirs=yes