Bump version to 2.4.1 for development of next release
[gnu-stow.git] / configure.ac
blobd79a4e775b72d9483b611d444f9403c893449800
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.4.1], [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 and also the TEXI2DVI
23 # variable.
24 AM_INIT_AUTOMAKE([-Wall -Werror -Wno-override dist-bzip2 foreign])
25 AC_PROG_INSTALL
27 dnl Check for perl on our system.
28 dnl Call to AC_SUBST(PERL) is implicit
29 AC_PATH_PROGS([PERL], [perl] [perl5], [false])
30 if test "x$PERL" = xfalse
31 then
32   AC_MSG_ERROR([Perl not found; check your \$PATH.])
35 missing_test_deps=
36 for mod in Test::More Test::Output; do
37   AC_MSG_CHECKING([$mod])
38   if $PERL -M$mod -e 1 2>/dev/null
39   then
40     AC_MSG_RESULT([yes])
41   else
42     AC_MSG_RESULT([no])
43     missing_test_deps="$missing_test_deps $mod"
44   fi
45 done
47 # N.B. ${var#pattern} will not work with some shells, such as
48 # Solaris 10's /bin/sh :-(
50 #   http://www.gnu.org/software/autoconf/manual/autoconf.html#Portable-Shell
52 #   eval `$PERL -V:siteprefix -V:installsitelib`
53 #   pmdir_relative_path="${installsitelib#$siteprefix/}"
55 # This will work:
57 #   pmdir_relative_path=`echo "${installsitelib}" | sed -e "s!^$siteprefix/!!"`
59 # but this is cleaner:
60 pmdir_relative_path=`\
61   $PERL -MConfig \
62         -wle '($_ = $Config{installsitelib})
63               =~ s!^\Q$Config{siteprefix}/!!; \
64               print'`
66 AC_ARG_WITH(
67     [pmdir],
68     AS_HELP_STRING(
69       [--with-pmdir=DIR],
70       [Install Perl modules in DIR]),
71     [PMDIR=${withval}],
72     [PMDIR='${prefix}'/"$pmdir_relative_path"])
73 AC_CONFIG_COMMANDS_POST([[
74   eval pmdir="$PMDIR"
75   cat <<EOF
77 # Perl modules will be installed to $PMDIR
78 EOF
79   if [ "$pmdir" != "$PMDIR" ]; then
80     cat <<EOF
81 # which will expand to
83 #   $pmdir
85 # unless you override the value of prefix at make-time.
86 EOF
87     echo
88   fi
90   if test -n "$missing_test_deps"; then
91     cat <<EOF >&2
92 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
93 ! WARNING!  $PERL was missing modules:
95 !   $missing_test_deps
97 ! The test suite will fail.  'make install' may still render
98 ! a working installation, but this cannot be guaranteed.
100 ! Please (re-)read INSTALL, then install the missing modules
101 ! and try again.
102 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
105     if test -n "$STRICT_TESTS"; then
106       exit 1
107     fi
108   fi
110 AC_SUBST([PMDIR])
112 AC_CONFIG_FILES([Makefile])
113 AC_OUTPUT