* THANKS (Daniel Richard G.): Update e-mail address.
[platform/upstream/automake.git] / configure.ac
1 # Process this file with autoconf to produce a configure script.
2
3 # Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
4 # 2004, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
9 # any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
19 AC_INIT([GNU Automake], [1.11], [bug-automake@gnu.org])
20
21 m4_ifndef([AC_PACKAGE_URL],
22           [AC_SUBST([PACKAGE_URL], [http://www.gnu.org/software/automake/])])
23
24 AC_CONFIG_SRCDIR(automake.in)
25 AC_CONFIG_AUX_DIR(lib)
26
27 AC_CANONICAL_BUILD
28
29 # Save the AUTOCONF setting before AM_INIT_AUTOMAKE overrides it; this
30 # way we can run Autoconf tests from configure (or from the test
31 # suite) without being bothered by `missing'.  Likewise for autom4te,
32 # autoreconf, autoheader, and autoupdate.
33 AC_SUBST([am_AUTOCONF], ["${AUTOCONF-autoconf}"])
34 AC_SUBST([am_AUTOM4TE], ["${AUTOM4TE-autom4te}"])
35 AC_SUBST([am_AUTORECONF], ["${AUTORECONF-autoreconf}"])
36 AC_SUBST([am_AUTOHEADER], ["${AUTOHEADER-autoheader}"])
37 AC_SUBST([am_AUTOUPDATE], ["${AUTOUPDATE-autoupdate}"])
38
39 AM_INIT_AUTOMAKE([1.10a dist-bzip2 filename-length-max=99 color-tests parallel-tests])
40
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
51 # A versioned directory, defined here for convenience.
52 AC_SUBST([pkgvdatadir], ["\${datadir}/$PACKAGE-$APIVERSION"])
53
54 # $AUTOMAKE and $ACLOCAL are always run after a `cd $top_srcdir',
55 # hence `.' is really what we want for perllibdir, libdir, and acdir.
56 ACLOCAL="perllibdir=\"`pwd`/lib$PATH_SEPARATOR./lib\" \"`pwd`/aclocal\" --acdir=m4 -I m4"
57 AUTOMAKE="perllibdir=\"`pwd`/lib$PATH_SEPARATOR./lib\" \"`pwd`/automake\" --libdir=lib"
58
59 AC_PATH_PROG(PERL, perl)
60 if test -z "$PERL"; then
61    AC_MSG_ERROR([perl not found])
62 fi
63 $PERL -e 'require 5.006;' || {
64    AC_MSG_ERROR(
65 [perl 5.6 or better is required; perl 5.8.2 or better
66 is recommended.  If you have several perl versions
67 installed, select the one Automake should use using
68   ./configure PERL=/path/to/perl])
69 }
70
71 # We require ithreads support, and version 5.7.2 for CLONE.
72 AC_CACHE_CHECK([whether $PERL supports ithreads], [am_cv_prog_PERL_ithreads],
73 [if $PERL -e '
74     require 5.007_002;
75     use Config;
76     if ($Config{useithreads})
77       {
78         require threads;
79         import threads;
80         require Thread::Queue;
81         import Thread::Queue;
82         exit 0;
83       }
84     exit 1;' >&AS_MESSAGE_LOG_FD 2>&1
85 then
86   am_cv_prog_PERL_ithreads=yes
87 else
88   am_cv_prog_PERL_ithreads=no
89 fi])
90 if test $am_cv_prog_PERL_ithreads = yes; then
91   PERL_THREADS=1;
92 else
93   PERL_THREADS=0;
94 fi
95 AC_SUBST([PERL_THREADS])
96
97 # The test suite will skip some tests if tex is absent.
98 AC_CHECK_PROG([TEX], [tex], [tex])
99
100 # Generate man pages.
101 AM_MISSING_PROG([HELP2MAN], [help2man])
102
103 # Test for Autoconf.  We run Autoconf in a subdirectory to ease
104 # deletion of any files created (such as those added to
105 # autom4te.cache).  We used to perform only the last of the three
106 # following tests, but some users were unable to figure out that their
107 # installation was broken since --version appeared to work.
108
109 required_autoconf_version=2.62
110 AC_CACHE_CHECK([whether autoconf is installed], [am_cv_autoconf_installed],
111 [if AM_RUN_LOG([eval $am_AUTOCONF --version]);
112 then
113   am_cv_autoconf_installed=yes
114 else
115   am_cv_autoconf_installed=no
116 fi])
117 if test "$am_cv_autoconf_installed" = no; then
118   AC_MSG_ERROR([Autoconf $required_autoconf_version or better is required.
119     Please make sure it is installed and in your PATH.])
120 fi
121
122 AC_CACHE_CHECK([whether autoconf works], [am_cv_autoconf_works],
123 [mkdir conftest
124 echo 'AC''_INIT' > conftest/conftest.ac
125 if AM_RUN_LOG([cd conftest && eval $am_AUTOCONF -o /dev/null conftest.ac]);
126 then
127   am_cv_autoconf_works=yes
128 else
129   am_cv_autoconf_works=no
130 fi
131 rm -rf conftest])
132 if test "$am_cv_autoconf_works" = no; then
133   AC_MSG_ERROR([The installed version of autoconf does not work.
134     Please check config.log for error messages before this one.])
135 fi
136
137 AC_CACHE_CHECK([whether autoconf is recent enough], [am_cv_autoconf_version],
138 [mkdir conftest
139 dnl Creative quoting required to avoid spurious expansion of AC_PREREQ macro
140 echo 'AC'"_PREREQ([[$required_autoconf_version]])" > conftest/conftest.ac
141 if AM_RUN_LOG([cd conftest && eval $am_AUTOCONF -o /dev/null conftest.ac]);
142 then
143   am_cv_autoconf_version=yes
144 else
145   am_cv_autoconf_version=no
146 fi
147 rm -rf conftest])
148 if test "$am_cv_autoconf_version" = no; then
149   AC_MSG_ERROR([Autoconf $required_autoconf_version or better is required.])
150 fi
151
152 # Test for ln.  We need use it to install the versioned binaries.
153 AC_MSG_CHECKING([whether ln works])
154 AC_CACHE_VAL([am_cv_prog_ln], [
155 rm -f conftest conftest.file
156 : >conftest.file
157 if ln conftest.file conftest 2>/dev/null; then
158   am_cv_prog_ln=ln
159 else
160   am_cv_prog_ln='cp -p'
161 fi
162 rm -f conftest conftest.file])
163 AC_SUBST([LN], [$am_cv_prog_ln])
164 result=no
165 test "x$am_cv_prog_ln" = xln && result=yes
166 AC_MSG_RESULT([$result])
167
168 # The amount we should wait after modifying files depends on the platform.
169 # On Windows '95, '98 and ME, files modifications have 2-seconds
170 # granularity and can be up to 3 seconds in the future w.r.t. the
171 # system clock.  When it is important to ensure one file is older
172 # than another we wait at least 5 seconds between creations.
173 case $build in
174   *-pc-msdosdjgpp) MODIFICATION_DELAY=5;;
175   *)               MODIFICATION_DELAY=2;;
176 esac
177 AC_SUBST([MODIFICATION_DELAY])
178
179 # Test for things needed by the test suite.
180 AC_PROG_EGREP
181 AC_PROG_FGREP
182
183 AC_CACHE_CHECK([whether /bin/sh has working 'set -e' with exit trap],
184 [am_cv_sh_errexit_works],
185 [if /bin/sh -ec "trap 'exit \$?' 0; (exit 77); exit 77"; test $? = 77
186 then
187   am_cv_sh_errexit_works=yes
188 else
189   am_cv_sh_errexit_works=no
190 fi
191 ])
192 if test $am_cv_sh_errexit_works = no; then
193   AC_MSG_WARN([`${MAKE-make} check' will leave leftover directories tests/*.dir])
194   AC_MSG_WARN([you can clean them up manually using `${MAKE-make} clean' or])
195   AC_MSG_WARN([`cd tests && ${MAKE-make} clean-local-check'])
196   dnl restore font-lock: `
197 fi
198 AC_SUBST([sh_errexit_works], [$am_cv_sh_errexit_works])
199
200 AC_CONFIG_FILES([
201   Makefile
202   doc/Makefile
203   lib/Automake/Makefile
204   lib/Automake/tests/Makefile
205   lib/Makefile
206   lib/am/Makefile
207   m4/Makefile
208   tests/Makefile
209   tests/defs
210 ])
211 AC_CONFIG_FILES([tests/aclocal-${APIVERSION}:tests/aclocal.in],
212                 [chmod +x tests/aclocal-${APIVERSION}],
213                 [APIVERSION=$APIVERSION])
214 AC_CONFIG_FILES([tests/automake-${APIVERSION}:tests/automake.in],
215                 [chmod +x tests/automake-${APIVERSION}])
216
217 AC_OUTPUT