emacs: tweak more cperl indentation config to match existing style
[gnu-stow.git] / configure.ac
blob4b74c6791fbf2a495e250c3f3a6e6e57730ba7ab
1 dnl This file is part of GNU Stow.
2 dnl
3 dnl GNU Stow is free software: you can redistribute it and/or modify it
4 dnl under the terms of the GNU General Public License as published by
5 dnl the Free Software Foundation, either version 3 of the License, or
6 dnl (at your option) any later version.
7 dnl
8 dnl GNU Stow is distributed in the hope that it will be useful, but
9 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
10 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 dnl General Public License for more details.
12 dnl
13 dnl You should have received a copy of the GNU General Public License
14 dnl along with this program. If not, see https://www.gnu.org/licenses/.
16 dnl Process this file with Autoconf to produce configure dnl
18 AC_INIT([stow], [2.3.2], [bug-stow@gnu.org])
19 AC_PREREQ([2.61])
20 AC_CONFIG_AUX_DIR([automake])
21 # Unfortunately we have to disable warnings for overrides, because we
22 # need to override the built-in `check-TESTS' rule.
23 AM_INIT_AUTOMAKE([-Wall -Werror -Wno-override dist-bzip2 foreign])
24 AC_PROG_INSTALL
26 dnl Check for perl on our system.
27 dnl Call to AC_SUBST(PERL) is implicit
28 AC_PATH_PROGS([PERL], [perl] [perl5], [false])
29 if test "x$PERL" = xfalse
30 then
31   AC_MSG_ERROR([Perl not found; check your \$PATH.])
34 missing_test_deps=
35 for mod in Test::More Test::Output; do
36   AC_MSG_CHECKING([$mod])
37   if $PERL -M$mod -e 1 2>/dev/null
38   then
39     AC_MSG_RESULT([yes])
40   else
41     AC_MSG_RESULT([no])
42     missing_test_deps="$missing_test_deps $mod"
43   fi
44 done
46 # N.B. ${var#pattern} will not work with some shells, such as
47 # Solaris 10's /bin/sh :-(
49 #   http://www.gnu.org/software/autoconf/manual/autoconf.html#Portable-Shell
51 #   eval `$PERL -V:siteprefix -V:installsitelib`
52 #   pmdir_relative_path="${installsitelib#$siteprefix/}"
54 # This will work:
56 #   pmdir_relative_path=`echo "${installsitelib}" | sed -e "s!^$siteprefix/!!"`
58 # but this is cleaner:
59 pmdir_relative_path=`\
60   $PERL -MConfig \
61         -wle '($_ = $Config{installsitelib})
62               =~ s!^\Q$Config{siteprefix}/!!; \
63               print'`
65 AC_ARG_WITH(
66     [pmdir],
67     AS_HELP_STRING(
68       [--with-pmdir=DIR],
69       [Install Perl modules in DIR]),
70     [PMDIR=${withval}],
71     [PMDIR='${prefix}'/"$pmdir_relative_path"])
72 AC_CONFIG_COMMANDS_POST([[
73   eval pmdir="$PMDIR"
74   cat <<EOF
76 # Perl modules will be installed to $PMDIR
77 EOF
78   if [ "$pmdir" != "$PMDIR" ]; then
79     cat <<EOF
80 # which will expand to
82 #   $pmdir
84 # unless you override the value of prefix at make-time.
85 EOF
86     echo
87   fi
89   if test -n "$missing_test_deps"; then
90     cat <<EOF >&2
91 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
92 ! WARNING!  $PERL was missing modules:
94 !   $missing_test_deps
96 ! The test suite will fail.  'make install' may still render
97 ! a working installation, but this cannot be guaranteed.
99 ! Please (re-)read INSTALL, then install the missing modules
100 ! and try again.
101 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
104     if test -n "$STRICT_TESTS"; then
105       exit 1
106     fi
107   fi
109 AC_SUBST([PMDIR])
111 AC_CONFIG_FILES([Makefile])
112 AC_OUTPUT