Cope with absent Perl modules threads and Thread::Queue.
[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  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 3, 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.10a], [bug-automake@gnu.org])
20
21 AC_CONFIG_SRCDIR(automake.in)
22 AC_CONFIG_AUX_DIR(lib)
23
24 AC_CANONICAL_BUILD
25
26 # Save the AUTOCONF setting before AM_INIT_AUTOMAKE overrides it; this
27 # way we can run Autoconf tests from configure (or from the test
28 # suite) without being bothered by `missing'.
29 AC_SUBST([am_AUTOCONF], ["${AUTOCONF-autoconf}"])
30
31 AM_INIT_AUTOMAKE([1.10a dist-bzip2 filename-length-max=99 color-tests])
32
33 # The API version is the base version.  We must guarantee
34 # compatibility for all releases with the same API version.
35 # Our current rule is that:
36 # * All releases, including the prereleases, in an X.Y series
37 #   are compatible.  So 1.5.1c is compatible with 1.5.
38 # * Prereleases on the trunk are all incompatible -- 1.5b and 1.5c
39 #   aren't the same.
40 APIVERSION=`echo "$VERSION" | sed -e 's/^\([[0-9]]*\.[[0-9]]*[[a-z]]*\).*$/\1/'`
41 AC_SUBST(APIVERSION)
42
43 # A versioned directory, defined here for convenience.
44 AC_SUBST([pkgvdatadir], ["\${datadir}/$PACKAGE-$APIVERSION"])
45
46 # $AUTOMAKE and $ACLOCAL are always run after a `cd $top_srcdir',
47 # hence `.' is really what we want for perllibdir, libdir, and acdir.
48 ACLOCAL="perllibdir=\"`pwd`/lib$PATH_SEPARATOR./lib\" \"`pwd`/aclocal\" --acdir=m4 -I m4"
49 AUTOMAKE="perllibdir=\"`pwd`/lib$PATH_SEPARATOR./lib\" \"`pwd`/automake\" --libdir=lib"
50
51 AC_PATH_PROG(PERL, perl)
52 if test -z "$PERL"; then
53    AC_MSG_ERROR([perl not found])
54 fi
55 $PERL -e 'require 5.006;' || {
56    AC_MSG_ERROR(
57 [perl 5.6 or better is required; perl 5.8.2 or better
58 is recommended.  If you have several perl versions
59 installed, select the one Automake should use using
60   ./configure PERL=/path/to/perl])
61 }
62
63 # We require ithreads support, and version 5.7.2 for CLONE.
64 AC_CACHE_CHECK([whether $PERL supports ithreads], [am_cv_prog_PERL_ithreads],
65 [if $PERL -e '
66     require 5.007_002;
67     use Config;
68     if ($Config{useithreads})
69       {
70         require threads;
71         import threads;
72         require Thread::Queue;
73         import Thread::Queue;
74         exit 0;
75       }
76     exit 1;' >&AS_MESSAGE_LOG_FD 2>&1
77 then
78   am_cv_prog_PERL_ithreads=yes
79 else
80   am_cv_prog_PERL_ithreads=no
81 fi])
82 if test $am_cv_prog_PERL_ithreads = yes; then
83   PERL_THREADS=1;
84 else
85   PERL_THREADS=0;
86 fi
87 AC_SUBST([PERL_THREADS])
88
89 # The test suite will skip some tests if tex is absent.
90 AC_CHECK_PROG([TEX], [tex], [tex])
91
92 # Generate man pages.
93 AM_MISSING_PROG([HELP2MAN], [help2man])
94
95 # Test for Autoconf.  We run Autoconf in a subdirectory to ease
96 # deletion of any files created (such as those added to
97 # autom4te.cache).  We used to perform only the last of the three
98 # following tests, but some users were unable to figure out that their
99 # installation was broken since --version appeared to work.
100
101 AC_CACHE_CHECK([whether autoconf is installed], [am_cv_autoconf_installed],
102 [if AM_RUN_LOG([eval $am_AUTOCONF --version]);
103 then
104   am_cv_autoconf_installed=yes
105 else
106   am_cv_autoconf_installed=no
107 fi])
108 if test "$am_cv_autoconf_installed" = no; then
109   AC_MSG_ERROR([Autoconf 2.60 or better is required.
110     Please make sure it is installed and in your PATH.])
111 fi
112
113 AC_CACHE_CHECK([whether autoconf works], [am_cv_autoconf_works],
114 [mkdir conftest
115 echo 'AC''_INIT' > conftest/conftest.ac
116 if AM_RUN_LOG([cd conftest && eval $am_AUTOCONF -o /dev/null conftest.ac]);
117 then
118   am_cv_autoconf_works=yes
119 else
120   am_cv_autoconf_works=no
121 fi
122 rm -rf conftest])
123 if test "$am_cv_autoconf_works" = no; then
124   AC_MSG_ERROR([The installed version of autoconf does not work.
125     Please check config.log for error messages before this one.])
126 fi
127
128 AC_CACHE_CHECK([whether autoconf is recent enough], [am_cv_autoconf_version],
129 [mkdir conftest
130 echo 'AC''_PREREQ([[2.62]])' > conftest/conftest.ac
131 if AM_RUN_LOG([cd conftest && eval $am_AUTOCONF -o /dev/null conftest.ac]);
132 then
133   am_cv_autoconf_version=yes
134 else
135   am_cv_autoconf_version=no
136 fi
137 rm -rf conftest])
138 if test "$am_cv_autoconf_version" = no; then
139   AC_MSG_ERROR([Autoconf 2.61a-341 or better is required.])
140 fi
141
142 # Test for ln.  We need use it to install the versioned binaries.
143 AC_MSG_CHECKING([whether ln works])
144 AC_CACHE_VAL([am_cv_prog_ln], [
145 rm -f conftest conftest.file
146 : >conftest.file
147 if ln conftest.file conftest 2>/dev/null; then
148   am_cv_prog_ln=ln
149 else
150   am_cv_prog_ln='cp -p'
151 fi
152 rm -f conftest conftest.file])
153 AC_SUBST([LN], [$am_cv_prog_ln])
154 result=no
155 test "x$am_cv_prog_ln" = xln && result=yes
156 AC_MSG_RESULT([$result])
157
158 # The amount we should wait after modifying files depends on the platform.
159 # On Windows '95, '98 and ME, files modifications have 2-seconds
160 # granularity and can be up to 3 seconds in the future w.r.t. the
161 # system clock.  When it is important to ensure one file is older
162 # than another we wait at least 5 seconds between creations.
163 case $build in
164   *-pc-msdosdjgpp) MODIFICATION_DELAY=5;;
165   *)               MODIFICATION_DELAY=2;;
166 esac
167 AC_SUBST([MODIFICATION_DELAY])
168
169 # Test for things needed by the test suite.
170 AC_PROG_EGREP
171 AC_PROG_FGREP
172
173 AC_CONFIG_FILES([
174   Makefile
175   doc/Makefile
176   lib/Automake/Makefile
177   lib/Automake/tests/Makefile
178   lib/Makefile
179   lib/am/Makefile
180   m4/Makefile
181   tests/Makefile
182   tests/defs
183 ])
184 AC_CONFIG_FILES([tests/aclocal-${APIVERSION}:tests/aclocal.in],
185                 [chmod +x tests/aclocal-${APIVERSION}],
186                 [APIVERSION=$APIVERSION])
187 AC_CONFIG_FILES([tests/automake-${APIVERSION}:tests/automake.in],
188                 [chmod +x tests/automake-${APIVERSION}])
189
190 AC_OUTPUT