configure.ac 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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/.
  15. dnl Process this file with Autoconf to produce configure dnl
  16. AC_INIT([stow], [2.3.2], [bug-stow@gnu.org])
  17. AC_PREREQ([2.61])
  18. AC_CONFIG_AUX_DIR([automake])
  19. # Unfortunately we have to disable warnings for overrides, because we
  20. # need to override the built-in `check' rule and also the TEXI2DVI
  21. # variable.
  22. AM_INIT_AUTOMAKE([-Wall -Werror -Wno-override dist-bzip2 foreign])
  23. AC_PROG_INSTALL
  24. dnl Check for perl on our system.
  25. dnl Call to AC_SUBST(PERL) is implicit
  26. AC_PATH_PROGS([PERL], [perl] [perl5], [false])
  27. if test "x$PERL" = xfalse
  28. then
  29. AC_MSG_ERROR([Perl not found; check your \$PATH.])
  30. fi
  31. missing_test_deps=
  32. for mod in Test::More Test::Output; do
  33. AC_MSG_CHECKING([$mod])
  34. if $PERL -M$mod -e 1 2>/dev/null
  35. then
  36. AC_MSG_RESULT([yes])
  37. else
  38. AC_MSG_RESULT([no])
  39. missing_test_deps="$missing_test_deps $mod"
  40. fi
  41. done
  42. # N.B. ${var#pattern} will not work with some shells, such as
  43. # Solaris 10's /bin/sh :-(
  44. #
  45. # http://www.gnu.org/software/autoconf/manual/autoconf.html#Portable-Shell
  46. #
  47. # eval `$PERL -V:siteprefix -V:installsitelib`
  48. # pmdir_relative_path="${installsitelib#$siteprefix/}"
  49. #
  50. # This will work:
  51. #
  52. # pmdir_relative_path=`echo "${installsitelib}" | sed -e "s!^$siteprefix/!!"`
  53. #
  54. # but this is cleaner:
  55. pmdir_relative_path=`\
  56. $PERL -MConfig \
  57. -wle '($_ = $Config{installsitelib})
  58. =~ s!^\Q$Config{siteprefix}/!!; \
  59. print'`
  60. AC_ARG_WITH(
  61. [pmdir],
  62. AS_HELP_STRING(
  63. [--with-pmdir=DIR],
  64. [Install Perl modules in DIR]),
  65. [PMDIR=${withval}],
  66. [PMDIR='${prefix}'/"$pmdir_relative_path"])
  67. AC_CONFIG_COMMANDS_POST([[
  68. eval pmdir="$PMDIR"
  69. cat <<EOF
  70. # Perl modules will be installed to $PMDIR
  71. EOF
  72. if [ "$pmdir" != "$PMDIR" ]; then
  73. cat <<EOF
  74. # which will expand to
  75. #
  76. # $pmdir
  77. #
  78. # unless you override the value of prefix at make-time.
  79. EOF
  80. echo
  81. fi
  82. if test -n "$missing_test_deps"; then
  83. cat <<EOF >&2
  84. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  85. ! WARNING! $PERL was missing modules:
  86. !
  87. ! $missing_test_deps
  88. !
  89. ! The test suite will fail. 'make install' may still render
  90. ! a working installation, but this cannot be guaranteed.
  91. !
  92. ! Please (re-)read INSTALL, then install the missing modules
  93. ! and try again.
  94. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  95. EOF
  96. if test -n "$STRICT_TESTS"; then
  97. exit 1
  98. fi
  99. fi
  100. ]])
  101. AC_SUBST([PMDIR])
  102. AC_CONFIG_FILES([Makefile])
  103. AC_OUTPUT