configure.ac 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. # Process this file with autoconf to produce a configure script.
  2. # Copyright (C) 1995-2017 Free Software Foundation, Inc.
  3. #
  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.
  8. #
  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.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. AC_PREREQ([2.69])
  17. AC_INIT([GNU Automake], [1.15.1], [bug-automake@gnu.org])
  18. AC_CONFIG_SRCDIR([bin/automake.in])
  19. AC_CONFIG_AUX_DIR([lib])
  20. AM_SILENT_RULES([yes])
  21. AC_CANONICAL_HOST
  22. AC_CANONICAL_BUILD
  23. # Save the AUTOCONF setting before AM_INIT_AUTOMAKE overrides it; this
  24. # way we can run Autoconf tests from configure (or from the test
  25. # suite) without being bothered by 'missing'. Likewise for autom4te,
  26. # autoreconf, autoheader, and autoupdate.
  27. AC_SUBST([am_AUTOCONF], ["${AUTOCONF-autoconf}"])
  28. AC_SUBST([am_AUTOM4TE], ["${AUTOM4TE-autom4te}"])
  29. AC_SUBST([am_AUTORECONF], ["${AUTORECONF-autoreconf}"])
  30. AC_SUBST([am_AUTOHEADER], ["${AUTOHEADER-autoheader}"])
  31. AC_SUBST([am_AUTOUPDATE], ["${AUTOUPDATE-autoupdate}"])
  32. dnl We call AC_PROG_CC in an unusual way, and only for use in our
  33. dnl testsuite, so also use 'no-dependencies' and 'no-define' among
  34. dnl the automake options to avoid bloating and potential problems.
  35. AM_INIT_AUTOMAKE([-Wall -Werror dist-xz filename-length-max=99
  36. no-define no-dependencies])
  37. # Keep this on a line of its own, since it must be found and processed
  38. # by the 'update-copyright' rule in our Makefile.
  39. RELEASE_YEAR=2017
  40. AC_SUBST([RELEASE_YEAR])
  41. # The API version is the base version. We must guarantee
  42. # compatibility for all releases with the same API version.
  43. # Our current rule is that:
  44. # * All releases, including the prereleases, in an X.Y series
  45. # are compatible. So 1.5.1c is compatible with 1.5.
  46. # * Prereleases on the trunk are all incompatible -- 1.5b and 1.5c
  47. # aren't the same.
  48. APIVERSION=`echo "$VERSION" | sed -e 's/^\([[0-9]]*\.[[0-9]]*[[a-z]]*\).*$/\1/'`
  49. AC_SUBST([APIVERSION])
  50. AC_SUBST([pkgvdatadir], ["\${datadir}/$PACKAGE-$APIVERSION"])
  51. AC_SUBST([scriptdir], ["\${pkgvdatadir}"])
  52. AC_SUBST([amdir], ["\${pkgvdatadir}/am"])
  53. AC_SUBST([automake_acdir], ["\${datadir}/aclocal-$APIVERSION"])
  54. AC_SUBST([system_acdir], ["\${datadir}/aclocal"])
  55. # Our build system is bootstrapped with the bleeding-edge versions of
  56. # aclocal and automake, hence the remake rules must use those versions
  57. # as well. The extra quoting is to cater to cases when the build
  58. # directory contains whitespace or shell metacharacters.
  59. ACLOCAL="\"`pwd`/t/wrap/aclocal-$APIVERSION\""
  60. AUTOMAKE="\"`pwd`/t/wrap/automake-$APIVERSION\""
  61. AC_PROG_LN_S
  62. AC_PATH_PROG([PERL], [perl])
  63. if test -z "$PERL"; then
  64. AC_MSG_ERROR([perl not found])
  65. fi
  66. # Save details about the selected perl interpreter in config.log.
  67. AM_RUN_LOG([$PERL --version])
  68. $PERL -e 'require 5.006;' || {
  69. AC_MSG_ERROR(
  70. [perl 5.6 or better is required; perl 5.8.2 or better
  71. is recommended. If you have several perl versions
  72. installed, select the one Automake should use using
  73. ./configure PERL=/path/to/perl])
  74. }
  75. # The test suite will skip some tests if tex is absent.
  76. AC_CHECK_PROG([TEX], [tex], [tex])
  77. # Save details about the selected TeX program in config.log.
  78. # Redirect input from /dev/null, as TeX might otherwise hang waiting
  79. # for input from the terminal.
  80. AM_RUN_LOG([$TEX --version </dev/null])
  81. # The test suite will skip some tests if no lex or yacc program is
  82. # available.
  83. # We don't use AC_PROG_LEX nor AC_PROG_YACC here because:
  84. # 1. we don't want flex (resp. bison) to be preferred to system lex
  85. # (resp. system yacc);
  86. # 2. we don't want $LEX (resp. $YACC) to be defined to ':' (resp. 'yacc')
  87. # by default;
  88. # 3. we prefer not to have the variables YFLAGS, LEX_OUTPUT_ROOT and
  89. # LEXLIB to be calculated and/or AC_SUBST'd;
  90. # 4. we prefer that the YACC and LEX variables are not reported in the
  91. # configure help screen.
  92. AC_CHECK_PROGS([YACC], [yacc byacc 'bison -y'], [false])
  93. AC_CHECK_PROGS([LEX], [lex flex], [false])
  94. # Test for Autoconf. We run Autoconf in a subdirectory to ease
  95. # deletion of any files created (such as those added to
  96. # autom4te.cache). We used to perform only the last of the three
  97. # following tests, but some users were unable to figure out that their
  98. # installation was broken since --version appeared to work.
  99. AC_SUBST([required_autoconf_version], [2.65])
  100. AC_CACHE_CHECK([whether autoconf is installed], [am_cv_autoconf_installed],
  101. [if AM_RUN_LOG([$am_AUTOCONF --version]);
  102. then
  103. am_cv_autoconf_installed=yes
  104. else
  105. am_cv_autoconf_installed=no
  106. fi])
  107. if test "$am_cv_autoconf_installed" = no; then
  108. AC_MSG_ERROR([Autoconf $required_autoconf_version or better is required.
  109. Please make sure it is installed and in your PATH.])
  110. fi
  111. AC_CACHE_CHECK([whether autoconf works], [am_cv_autoconf_works],
  112. [mkdir conftest
  113. echo 'AC''_INIT' > conftest/conftest.ac
  114. if AM_RUN_LOG([cd conftest && $am_AUTOCONF -o /dev/null conftest.ac]);
  115. then
  116. am_cv_autoconf_works=yes
  117. else
  118. am_cv_autoconf_works=no
  119. fi
  120. rm -rf conftest])
  121. if test "$am_cv_autoconf_works" = no; then
  122. AC_MSG_ERROR([The installed version of autoconf does not work.
  123. Please check config.log for error messages before this one.])
  124. fi
  125. AC_CACHE_CHECK([whether autoconf is recent enough], [am_cv_autoconf_version],
  126. [mkdir conftest
  127. dnl Creative quoting required to avoid spurious expansion of AC_PREREQ macro
  128. echo 'AC'"_PREREQ([[$required_autoconf_version]])" > conftest/conftest.ac
  129. if AM_RUN_LOG([cd conftest && $am_AUTOCONF -o /dev/null conftest.ac]);
  130. then
  131. am_cv_autoconf_version=yes
  132. else
  133. am_cv_autoconf_version=no
  134. fi
  135. rm -rf conftest])
  136. if test "$am_cv_autoconf_version" = no; then
  137. AC_MSG_ERROR([Autoconf $required_autoconf_version or better is required.])
  138. fi
  139. # Test for ln. We need use it to install the versioned binaries.
  140. AC_MSG_CHECKING([whether ln works])
  141. AC_CACHE_VAL([am_cv_prog_ln], [
  142. rm -f conftest conftest.file
  143. : >conftest.file
  144. if ln conftest.file conftest 2>/dev/null; then
  145. am_cv_prog_ln=ln
  146. else
  147. am_cv_prog_ln='cp -p'
  148. fi
  149. rm -f conftest conftest.file])
  150. AC_SUBST([LN], [$am_cv_prog_ln])
  151. result=no
  152. test "x$am_cv_prog_ln" = xln && result=yes
  153. AC_MSG_RESULT([$result])
  154. # The amount we should wait after modifying files depends on the platform.
  155. # On Windows '95, '98 and ME, files modifications have 2-seconds
  156. # granularity and can be up to 3 seconds in the future w.r.t. the
  157. # system clock. When it is important to ensure one file is older
  158. # than another we wait at least 5 seconds between creations.
  159. case $build in
  160. *-pc-msdosdjgpp) MODIFICATION_DELAY=5;;
  161. *) MODIFICATION_DELAY=2;;
  162. esac
  163. AC_SUBST([MODIFICATION_DELAY])
  164. ## ------------------------------------------- ##
  165. ## Test for things needed by the test suite. ##
  166. ## ------------------------------------------- ##
  167. AC_PROG_EGREP
  168. AC_PROG_FGREP
  169. dnl FIXME: could we extract this in a simpler way through autoconf
  170. dnl FIXME: idioms or internals?
  171. AC_DEFUN(
  172. [_AM_INIT_BOURNE_COMPATIBLE_VAR],
  173. [am_bourne_compatible="AS_ESCAPE(_m4_expand([AS_BOURNE_COMPATIBLE]))"])
  174. dnl
  175. dnl Arguments to this macro:
  176. dnl
  177. dnl $1 - shell to test
  178. dnl $2 - description of the tested feature
  179. dnl $3 - shell code used to check the feature; to indicate success,
  180. dnl it can either exit with status 77, or have the last command
  181. dnl returning with exit status of zero
  182. dnl $4 - shell code to execute if the check on the shell is successful
  183. dnl (defaults to nothing)
  184. dnl $5 - shell code to execute if the check on the shell is not
  185. dnl successful (defaults to nothing)
  186. dnl
  187. AC_DEFUN([_AM_CHECK_SHELL_FEATURE],
  188. [AC_REQUIRE([_AM_INIT_BOURNE_COMPATIBLE_VAR])
  189. AC_MSG_CHECKING([whether $1 $2])
  190. if { $1 -c "$am_bourne_compatible
  191. AS_ESCAPE([$3])
  192. test \$? -eq 0 || exit 1
  193. # Use 77 to indicate success (rather than 0), in case some shell
  194. # acts like Solaris 10's /bin/sh, exiting successfully on some
  195. # syntax errors.
  196. exit 77" >&AS_MESSAGE_LOG_FD 2>&1; test $? -eq 77; }
  197. then
  198. AC_MSG_RESULT([yes])
  199. $4
  200. else
  201. AC_MSG_RESULT([no])
  202. $5
  203. fi])
  204. # AM_CHECK_CANDIDATE_TEST_SHELL(SHELL-PATH)
  205. # -----------------------------------------
  206. #
  207. # Check if the given shell is good enough to run our test scripts.
  208. # Inspired to gnulib's 'tests/init.sh'.
  209. #
  210. # We require POSIX and XSI features (e.g., '$(...)' for command
  211. # substitutions, '$((...))' for shell arithmetic, and support for
  212. # '${var#...}' and '${var%...}' parameter expansions).
  213. #
  214. # We require that the shell can correctly trap EXIT when 'set -e' is in
  215. # effect (OSF1/Tru64 sh failed to do so, see commit v1.10b-52-g9fe8259).
  216. #
  217. # We want to able to define shell aliases with the same name of shell
  218. # builtins.
  219. #
  220. # We also prefer shells that, when 'set -x' is in effect, do not also
  221. # redirect traces upon stderr redirections. For example,
  222. # $ set -x; echo x 2>file
  223. # would emit "+ echo x" into file with older zsh versions. Similarly,
  224. # $ set -x; P=1 true 2>file
  225. # would emit "P=1" into file with /usr/xpg4/bin/sh from Solaris 10 and
  226. # /bin/sh from SunOS 5.11 and OpenBSD 4.7.
  227. #
  228. # Use '$am_score' to indicate the degree of acceptability of the shell.
  229. # A score of "10" means that the shell is good enough for our needs;
  230. # a score of "9" means that the shell has some minor bugs or limitation,
  231. # but is still (barely) acceptable for our uses. Any other score means
  232. # that the shell is broken or unfit.
  233. #
  234. AC_DEFUN([_AM_CHECK_CANDIDATE_SHELL],
  235. [am_score=10
  236. while :; do
  237. _AM_CHECK_SHELL_FEATURE([$1],
  238. [supports \$(cmd)],
  239. [test "$(echo x)" = x],
  240. [], [am_score=1; break])
  241. _AM_CHECK_SHELL_FEATURE([$1],
  242. [supports \$((expr))],
  243. [test $((1 + 2 * 3)) = 7],
  244. [], [am_score=1; break])
  245. _AM_CHECK_SHELL_FEATURE([$1],
  246. [supports \${@%:@var}],
  247. [zero='' one='x' twelve=' foobar baz!' \
  248. && test ${@%:@zero} -eq 0 \
  249. && test ${@%:@one} -eq 1 \
  250. && test ${@%:@twelve} -eq 12],
  251. [], [am_score=1; break])
  252. _AM_CHECK_SHELL_FEATURE([$1],
  253. [supports \${var@%:@glob} and \${var%glob}],
  254. [v=a/b/c \
  255. && test ${v@%:@*/} = b/c \
  256. && test ${v@%:@@%:@*/} = c \
  257. && test ${v%/*} = a/b \
  258. && test ${v%%/*} = a],
  259. [], [am_score=1; break])
  260. _AM_CHECK_SHELL_FEATURE([$1],
  261. [preserves exit traps with "set -e"],
  262. [set -e; trap 'exit $?' 0; (exit 77); exit 77],
  263. [], [am_score=1; break])
  264. _AM_CHECK_SHELL_FEATURE([$1],
  265. [can define exit traps in a shell function],
  266. [fail=0 && foo() { trap 'fail=1' 0; } && foo && test $fail = 0],
  267. [], [am_score=1; break])
  268. _AM_CHECK_SHELL_FEATURE([$1],
  269. [corrupts stderr with "set -x"],
  270. [(set -x; P=1 true 2>&3) 3>&1 2>/dev/null | grep P=1],
  271. [am_score=9], [])
  272. echo 'return 34' > conftest-return.sh
  273. echo 'ok=no' >> conftest-return.sh
  274. _AM_CHECK_SHELL_FEATURE([$1],
  275. [can return early from "dot-sourced" files],
  276. [ok=yes; . ./conftest-return.sh; test $? -eq 34 && test $ok = yes],
  277. [rm -f conftest-return.sh],
  278. [rm -f conftest-return.sh; am_score=1; break])
  279. echo 'alias false=echo' > conftest-alias.sh
  280. echo 'false && test "$(false 97)" = 97' >> conftest-alias.sh
  281. _AM_CHECK_SHELL_FEATURE([$1],
  282. [supports alias named like shell builtins],
  283. [. ./conftest-alias.sh],
  284. [rm -f conftest-alias.sh],
  285. [rm -f conftest-alias.sh; am_score=1; break])
  286. _AM_CHECK_SHELL_FEATURE([$1],
  287. [supports "test -e"],
  288. [test -e config.log && test -e . && test ! -e nonesuch],
  289. [], [am_score=1; break])
  290. break
  291. done])
  292. # These messages only goes to the config.log file.
  293. AC_MSG_NOTICE([will now look for a sturdy POSIX shell, for our testsuite])
  294. AC_CACHE_VAL(
  295. [ac_cv_AM_TEST_RUNNER_SHELL],
  296. [if test "$AM_TEST_RUNNER_SHELL"; then
  297. # Let the user override it.
  298. ac_cv_AM_TEST_RUNNER_SHELL=$AM_TEST_RUNNER_SHELL
  299. else
  300. ac_cv_AM_TEST_RUNNER_SHELL=no
  301. am_candidate_shells=${CONFIG_SHELL-}
  302. # For the benefit of Solaris.
  303. am_PATH=$PATH$PATH_SEPARATOR/usr/xpg6/bin$PATH_SEPARATOR/usr/xpg4/bin
  304. for am_sh in sh sh5 dash ash bash zsh ksh pdksh; do
  305. AC_PATH_PROG([am_candidate_sh], [$am_sh], [], [$am_PATH])
  306. if test -n "$am_candidate_sh"; then
  307. am_candidate_shells="$am_candidate_shells $am_candidate_sh"
  308. fi
  309. AM_SUBST_NOTMAKE([am_candidate_sh])
  310. # Must nullify these in order not to interfere with the checks in
  311. # the next loop.
  312. AS_UNSET([am_candidate_sh])
  313. AS_UNSET([ac_cv_path_am_candidate_sh])
  314. done
  315. AS_UNSET([am_PATH]) # Not required anymore
  316. for am_sh in $am_candidate_shells; do
  317. am_score=0
  318. _AM_CHECK_CANDIDATE_SHELL([$am_sh])
  319. if test $am_score -eq 9; then
  320. # The shell is barely acceptable for our needs. We might
  321. # still find one that is even better, so continue looking.
  322. AC_MSG_NOTICE([shell $am_sh is acceptable, but we might do better])
  323. ac_cv_AM_TEST_RUNNER_SHELL=$am_sh
  324. elif test $am_score -eq 10; then
  325. AC_MSG_NOTICE([shell $am_sh is good enough, stop looking])
  326. ac_cv_AM_TEST_RUNNER_SHELL=$am_sh
  327. break
  328. fi
  329. done
  330. fi
  331. AM_TEST_RUNNER_SHELL=$ac_cv_AM_TEST_RUNNER_SHELL])
  332. if test $AM_TEST_RUNNER_SHELL = no; then
  333. AC_MSG_FAILURE([m4_normalize([no POSIX shell found that is good
  334. enough to be used in our testsuite])])
  335. else
  336. AC_MSG_NOTICE([will use $AM_TEST_RUNNER_SHELL as the testsuite shell])
  337. fi
  338. AC_ARG_VAR([AM_TEST_RUNNER_SHELL],
  339. [a sturdy POSIX shell for our testsuite])
  340. ###########################################################################
  341. # Look for C, C++ and fortran compilers to be used in the testsuite.
  342. dnl We don't want to abort our configuration script if no C compiler is
  343. dnl available, as such a compiler is only required to run part of the
  344. dnl testsuite, not to build or install Automake. Ditto for C++, Fortran
  345. dnl and Fortran 77 compilers. Unfortunately, autoconf does not offer an
  346. dnl easy way to obtain this behaviour, so we'll need a few hacks.
  347. dnl We want the body of this macro to expand as a single shell statement,
  348. dnl thus we wrap it into { ... } brackets.
  349. AC_DEFUN([_AM_WRAP_MSG_ERROR], [ {
  350. AC_MSG_WARN([$1])
  351. am__failed=yes
  352. break
  353. } ])
  354. AC_DEFUN([_AM_COMPILER_CAN_FAIL], [
  355. m4_pushdef([AC_MSG_FAILURE], m4_defn([_AM_WRAP_MSG_ERROR]))
  356. m4_pushdef([AC_MSG_ERROR], m4_defn([_AM_WRAP_MSG_ERROR]))
  357. am__failed=no
  358. while :; do
  359. $1
  360. break
  361. done
  362. AS_IF([test $am__failed = yes], [$2])
  363. # We have to clear these cache variables, so that future checks on
  364. # compilers for different languages won't be confused.
  365. unset ac_cv_objext ac_cv_exeext
  366. # We also need to meddle with the autoconf internals to ensure that
  367. # checks to find object and executable extensions will be run anew.
  368. # FIXME: In the long run, the better thing to do would be to fix
  369. # FIXME: autoconf instead ...
  370. m4_undefine([m4_provide(_AC_COMPILER_OBJEXT)])
  371. m4_undefine([m4_provide(_AC_COMPILER_EXEEXT)])
  372. m4_popdef([AC_MSG_FAILURE])
  373. m4_popdef([AC_MSG_ERROR])
  374. ])
  375. AC_DEFUN([_AM_SKIP_COMP_TESTS],
  376. [AC_MSG_NOTICE([tests requiring the $1 compiler will be skipped])])
  377. # Prefer generic compilers to GNU ones when possible. This will ensure
  378. # more testsuite coverage "in the wild".
  379. # Note that we don't look for the MSVC C/C++ compiler here. This is
  380. # deliberate; for more discussion and rationale, see:
  381. # <http://lists.gnu.org/archive/html/automake-patches/2012-01/msg00130.html>
  382. AC_MSG_NOTICE([will now look for generic compilers])
  383. # C compiler.
  384. _AM_COMPILER_CAN_FAIL(dnl
  385. [AC_PROG_CC([cc gcc])],
  386. [CC=false; _AM_SKIP_COMP_TESTS([C])])
  387. AS_IF([test x"$GCC" = x"yes"], [am_CC_is_GNU=yes], [am_CC_is_GNU=no])
  388. # On case-insensitive file systems (seen e.g. on Cygwin and Mac OS X)
  389. # we must avoid looking for 'CC', because that would be the same as
  390. # 'cc', and could cause $CXX to point to the C compiler, instead of
  391. # to a C++ compiler as expected (see automake bugs #11893 and #10766).
  392. # Similarly, we must avoid looking for 'RCC', as that can point to the
  393. # Qt4 "Resource Compiler": <http://doc.qt.digia.com/4.2/rcc.html>
  394. if test -f /bIn/rMdIr || test -f /uSr/bIn/rMdIr; then
  395. # Case-insensitive file system, don't look for CC.
  396. am_CC= am_RCC=
  397. else
  398. am_CC=CC am_RCC=RCC
  399. fi
  400. # The list of C++ compilers here has been copied, pasted and edited
  401. # from 'lib/autoconf/c.m4:AC_PROG_CXX' in the Autoconf distribution.
  402. # Keep it in sync, or better again, find out a way to avoid this code
  403. # duplication.
  404. _AM_COMPILER_CAN_FAIL([AC_PROG_CXX(dnl
  405. [aCC $am_CC FCC KCC $am_RCC xlC_r xlC c++ cxx cc++ gpp g++])],
  406. [CXX=false; _AM_SKIP_COMP_TESTS([C++])])
  407. AS_IF([test x"$GXX" = x"yes"], [am_CXX_is_GNU=yes], [am_CXX_is_GNU=no])
  408. # The lists of Fortran compilers here has been copied, pasted and edited
  409. # from file 'lib/autoconf/fortran.m4' in the Autoconf distribution.
  410. # Keep it in sync, or better again, find out a way to avoid this code
  411. # duplication.
  412. _AM_COMPILER_CAN_FAIL([AC_PROG_FC(dnl
  413. [xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor] dnl
  414. [xlf90 f90 pgf90 pghpf epcf90 g95 gfortran])],
  415. [FC=false; _AM_SKIP_COMP_TESTS([Fortran])])
  416. AS_IF([test x"$GFC" = x"yes"], [am_FC_is_GNU=yes], [am_FC_is_GNU=no])
  417. _AM_COMPILER_CAN_FAIL([AC_PROG_F77(dnl
  418. [xlf f77 frt pgf77 cf77 fort77 fl32 af77 g77 gfortran])],
  419. [F77=false; _AM_SKIP_COMP_TESTS([Fortran 77])])
  420. AS_IF([test x"$G77" = x"yes"], [am_F77_is_GNU=yes], [am_F77_is_GNU=no])
  421. # Some tests will need the GNU compilers. Searching for them here would
  422. # be overkill, since our testsuite already handles their search and setup
  423. # pretty well. But in case the compilers already found are the GNU ones,
  424. # we want to use them in the testsuite where GNU compilers are required.
  425. # Also, in case the compilers detected above (at configure time) are not
  426. # the GNU ones, we cannot use the values of CFLAGS, CXXFLAGS, FCFLAGS and
  427. # FFLAGS detected for them with the GNU compilers too, since it's likely
  428. # they won't be compatible. So we allow the user to define variants of
  429. # these variables for the GNU compilers separately.
  430. AC_MSG_NOTICE([will now look for GNU compilers])
  431. # GNU C compiler.
  432. AC_ARG_VAR([GNU_CC], [GNU C compiler])
  433. AC_ARG_VAR([GNU_CFLAGS], [GNU C compiler flags])
  434. if test $am_CC_is_GNU = yes; then
  435. AC_MSG_NOTICE([$CC is already a GNU C compiler])
  436. GNU_CC=$CC GNU_CFLAGS=${GNU_CFLAGS-$CFLAGS}
  437. else
  438. AC_CHECK_TOOLS([GNU_CC], [gcc], [false])
  439. fi
  440. if test "$GNU_CC" != false; then
  441. AS_IF([AM_RUN_LOG([$GNU_CC --version && $GNU_CC -v])], [],
  442. [AC_MSG_WARN([botched installation for GNU C compiler])
  443. _AM_SKIP_COMP_TESTS([GNU C])])
  444. fi
  445. # GNU C++ compiler.
  446. AC_ARG_VAR([GNU_CXX], [GNU C++ compiler])
  447. AC_ARG_VAR([GNU_CXXFLAGS], [GNU C++ compiler flags])
  448. if test $am_CXX_is_GNU = yes; then
  449. AC_MSG_NOTICE([$CXX is already a GNU C++ compiler])
  450. GNU_CXX=$CXX
  451. GNU_CXXFLAGS=${GNU_CXXFLAGS-$CXXFLAGS}
  452. else
  453. AC_CHECK_TOOLS([GNU_CXX], [g++ gpp], [false])
  454. fi
  455. if test "$GNU_CXX" != false; then
  456. AS_IF([AM_RUN_LOG([$GNU_CXX --version && $GNU_CXX -v])], [],
  457. [AC_MSG_WARN([botched installation for GNU C++ compiler])
  458. _AM_SKIP_COMP_TESTS([GNU C++])])
  459. fi
  460. # GNU Fortran compiler.
  461. AC_ARG_VAR([GNU_FC], [GNU Fortran compiler])
  462. AC_ARG_VAR([GNU_FCFLAGS], [GNU Fortran compiler flags])
  463. if test $am_FC_is_GNU = yes; then
  464. AC_MSG_NOTICE([$FC is already a GNU Fortran compiler])
  465. GNU_FC=$FC
  466. GNU_FCFLAGS=${GNU_FCFLAGS-$FCFLAGS}
  467. else
  468. AC_CHECK_TOOLS([GNU_FC], [gfortran], [false])
  469. fi
  470. if test "$GNU_FC" != false; then
  471. AS_IF([AM_RUN_LOG([$GNU_FC --version && $GNU_FC -v])], [],
  472. [AC_MSG_WARN([botched installation for GNU Fortran compiler])
  473. _AM_SKIP_COMP_TESTS([GNU Fortran])])
  474. fi
  475. # GNU Fortran 77 compiler.
  476. AC_ARG_VAR([GNU_F77], [GNU Fortran 77 compiler])
  477. AC_ARG_VAR([GNU_FFLAGS], [GNU Fortran 77 compiler flags])
  478. if test $am_F77_is_GNU = yes; then
  479. AC_MSG_NOTICE([$F77 is already a GNU Fortran 77 compiler])
  480. GNU_F77=$F77
  481. GNU_FFLAGS=${GNU_FFLAGS-$FFLAGS}
  482. else
  483. AC_CHECK_TOOLS([GNU_F77], [g77 gfortran], [false])
  484. fi
  485. if test "$GNU_F77" != false; then
  486. AS_IF([AM_RUN_LOG([$GNU_F77 --version && $GNU_F77 -v])], [],
  487. [AC_MSG_WARN([botched installation for GNU Fortran 77 compiler])
  488. _AM_SKIP_COMP_TESTS([GNU Fortran 77])])
  489. fi
  490. # GNU Java compiler.
  491. AC_ARG_VAR([GNU_GCJ], [GNU Java compiler])
  492. AC_ARG_VAR([GNU_GCJFLAGS], [GNU Java compiler flags])
  493. AC_CHECK_TOOLS([GNU_GCJ], [gcj], [false])
  494. if test "$GNU_GCJ" != false; then
  495. AS_IF([AM_RUN_LOG([$GNU_GCJ --version && $GNU_GCJ -v])], [],
  496. [AC_MSG_WARN([botched installation for GNU Java compiler])
  497. _AM_SKIP_COMP_TESTS([GNU Java])])
  498. fi
  499. # If we have been able to find at least a working compiler above, we
  500. # know what the object and executable extensions for this platform are.
  501. OBJEXT=${ac_cv_objext-UNKNOWN}
  502. EXEEXT=${ac_cv_exeext-UNKNOWN}
  503. AC_SUBST([OBJEXT])
  504. AC_SUBST([EXEEXT])
  505. ###########################################################################
  506. ## ---------------------- ##
  507. ## Create output files. ##
  508. ## ---------------------- ##
  509. AC_CONFIG_FILES([Makefile])
  510. AC_CONFIG_LINKS([GNUmakefile:GNUmakefile])
  511. AC_CONFIG_FILES([t/wrap/aclocal-${APIVERSION}:t/wrap/aclocal.in],
  512. [chmod +x t/wrap/aclocal-${APIVERSION}],
  513. [APIVERSION=$APIVERSION])
  514. AC_CONFIG_FILES([t/wrap/automake-${APIVERSION}:t/wrap/automake.in],
  515. [chmod +x t/wrap/automake-${APIVERSION}],
  516. [APIVERSION=$APIVERSION])
  517. AC_OUTPUT
  518. # Inform the user if this version of automake is a beta release or
  519. # a development snapshot.
  520. # According to HACKING, the version of a development snapshot should
  521. # end with an "odd" letter (a, c, ...), the version of a test release
  522. # should end wit an "even" letter (b, d, ...).
  523. am_stable_version_rx='[[1-9]\.[0-9]+(\.[0-9]+)?]'
  524. am_beta_version_rx="[$am_stable_version_rx[bdfhjlnprtvxz]]"
  525. am_release_type=`AS_ECHO(["$PACKAGE_VERSION"]) | LC_ALL=C awk ["
  526. /^$am_stable_version_rx$/ { print \"stable\"; exit(0); }
  527. /^$am_beta_version_rx$/ { print \"beta version\"; exit(0); }
  528. { print \"development snapshot\"; }"]`
  529. # '$silent' is set to yes if configure is passed the '--quiet' option.
  530. test "$am_release_type" = stable || test "$silent" = yes || cat <<EOF
  531. WARNING: You are about to use a $am_release_type of automake.
  532. WARNING: It might easily suffer from new bugs or regressions.
  533. WARNING: You are strongly advised not to use it in production code.
  534. Please report bugs, problems and feedback to <AC_PACKAGE_BUGREPORT>.
  535. EOF
  536. AS_EXIT([0])