Imported Upstream version 2.4.2
[platform/upstream/libtool.git] / configure.ac
1 # Process this file with autoconf to create configure. -*- autoconf -*-
2
3 #   Copyright (C) 2001, 2004, 2005, 2008, 2010 Free Software Foundation,
4 #   Inc.
5 #   Written by Gary V. Vaughan, 2001
6 #
7 #   This file is part of GNU Libtool.
8 #
9 # GNU Libtool is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation; either version 2 of
12 # the License, or (at your option) any later version.
13 #
14 # GNU Libtool is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with GNU Libtool; see the file COPYING.  If not, a copy
21 # can be downloaded from  http://www.gnu.org/licenses/gpl.html,
22 # or obtained by writing to the Free Software Foundation, Inc.,
23 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 ####
25
26
27 AC_PREREQ(2.62)dnl Some m4sh scripts use $as_echo
28 dnl Oldest automake required for bootstrap is below in AM_INIT_AUTOMAKE.
29
30
31 ## ------------------------ ##
32 ## Autoconf initialisation. ##
33 ## ------------------------ ##
34 AC_INIT([GNU Libtool], [2.4.2], [bug-libtool@gnu.org])
35 m4_ifndef([AC_PACKAGE_URL],
36           [AC_SUBST([PACKAGE_URL], [http://www.gnu.org/software/libtool/])])
37 AC_CONFIG_HEADERS([config.h:config-h.in])
38 AC_CONFIG_SRCDIR([libtoolize.in])
39 LT_CONFIG_LTDL_DIR([libltdl], [nonrecursive])
40 AC_CONFIG_AUX_DIR([libltdl/config])
41 AC_CONFIG_MACRO_DIR([libltdl/m4])
42 AC_CONFIG_LIBOBJ_DIR([libltdl])
43
44
45 ## ------------------------ ##
46 ## Autotest initialisation. ##
47 ## ------------------------ ##
48
49 AC_CONFIG_TESTDIR([tests])
50 AC_SUBST([AUTOM4TE], [${AUTOM4TE=autom4te}])
51 AC_SUBST([AUTOTEST], ['$(AUTOM4TE) --language=autotest'])
52
53
54 ## ---------------------------------------- ##
55 ## Display a configure time version banner. ##
56 ## ---------------------------------------- ##
57
58 # Calculating the previous version is somewhat involved, so do it once
59 # here, and SUBST the result for the maintainer release rules.  The
60 # versioning scheme we use is described here:
61 #       http://www.gnu.org/software/libtool/contribute.html
62
63 # First we break the version number up into its constituent parts.
64 lt_major=`echo "AC_PACKAGE_VERSION" | sed ['s,\..*$,,g']`
65 lt_minor=`echo "AC_PACKAGE_VERSION" | sed ['s,^[0-9]*\.\([0-9]*\).*$,\1,']`
66 lt_micro=`echo "AC_PACKAGE_VERSION" | sed ['s,^[0-9]*\.[0-9]*\(\.[0-9]*\).*$,\1,']`
67 lt_alpha=`echo "AC_PACKAGE_VERSION" | sed ['s,^[0-9.]*,,']`
68
69 test "$lt_minor" = "AC_PACKAGE_VERSION" && lt_minor=0
70 test "$lt_micro" = "AC_PACKAGE_VERSION" && lt_micro=""
71
72 # Then we try to work out what the release before this one would have been
73 # numbered.  The only time we come unstuck is when this is the first release
74 # from a stable branch (lt_micro=lt_alpha=""), so LASTRELEASE is the last
75 # release from the old stable branch, and we don't know what version that
76 # was, so leave it unset so that the Makefile can complain.
77 case $lt_alpha in
78   [[ab]])
79     case $lt_micro in
80       [.[01]])
81         LASTRELEASE="$lt_major.$lt_minor" ;;
82       *)
83         LASTRELEASE="$lt_major.$lt_minor$lt_micro" ;;
84     esac
85     ;;
86   [[cegikmoqsuwy]])
87     LASTRELEASE=`echo "AC_PACKAGE_VERSION" | tr 'c-y' 'b-w'` ;;
88   [[dfhjlnprtvxz]])
89     LASTRELEASE=`echo "AC_PACKAGE_VERSION" | tr 'd-z' 'b-x'` ;;
90   *) # No lt_alpha component
91     case $lt_micro in
92       .0)
93         LASTRELEASE="" ;;
94       .1)
95         LASTRELEASE="$lt_major.$lt_minor" ;;
96       .*)
97         lt_micro_value=`echo $lt_micro | sed 's,^\.,,'`
98         LASTRELEASE="$lt_major.$lt_minor.`expr $lt_micro_value - 1`" ;;
99       *)
100         LASTRELEASE="" ;;
101     esac
102     ;;
103 esac
104 AC_SUBST([LASTRELEASE])
105
106 # This is a sanity check so we can see which version is used in bug reports.
107 # It is assumed that we only want to see the date extension for cvs libtool
108 # versions (i.e. "odd" letters) and not actual alpha releases.
109 TIMESTAMP=`${CONFIG_SHELL} ${ac_aux_dir}/mkstamp ${srcdir}`
110 package_revision=`( set $TIMESTAMP; echo $1; )`
111 case $lt_alpha in
112   ""|[[bdfhjlnprtvxz]])
113     TIMESTAMP=
114     ;;
115 esac
116 timestamp_string="${TIMESTAMP:+ (Build:$TIMESTAMP)}"
117 AS_BOX([Configuring AC_PACKAGE_TARNAME$timestamp_string AC_PACKAGE_VERSION])
118 echo
119 AC_SUBST([TIMESTAMP])
120 AC_SUBST([package_revision])
121
122
123 ## ------------------------ ##
124 ## Automake Initialisation. ##
125 ## ------------------------ ##
126
127 dnl These are bootstrap requirements! Once built, libtool may work with
128 dnl much older releases of autoconf and automake.  See release notes.
129 dnl 1.11 is needed for color-tests, 1.11.1 fixes a security issue.
130 AM_INIT_AUTOMAKE([1.11.1 gnu subdir-objects dist-xz color-tests parallel-tests])
131
132
133 ## ------------------------- ##
134 ## Autobuild initialisation. ##
135 ## ------------------------- ##
136
137 # You can set autobuild_mode at configure time to specify a "unique"
138 # string for this build.
139 : ${autobuild_mode=default}
140 AB_VERSION="AC_PACKAGE_VERSION ($TIMESTAMP)"
141 AB_INIT([$autobuild_mode])
142
143
144 dnl We use m4sh to generate libtool's portable shell scripts
145 AC_SUBST([M4SH], ['$(AUTOM4TE) --language=m4sh'])
146
147 dnl Make sure config.status is regenerated when the version timestamp changes
148 AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/ChangeLog'])
149
150
151 ## ------------------------------- ##
152 ## Libtool specific configuration. ##
153 ## ------------------------------- ##
154
155 AC_SUBST([aclocaldir], ["\${datadir}/aclocal"])
156 AC_SUBST([pkgdatadir], ["\${datadir}/$PACKAGE"])
157
158 AC_ARG_ENABLE(ltdl-install,
159     [AS_HELP_STRING([--disable-ltdl-install], [do not install libltdl])])
160 if test x"${enable_ltdl_install+set}" != xset; then
161   enable_ltdl_install=yes
162 fi
163
164 # All subdirectories that are configured on demand, but that must be
165 # included in the distribution.
166 CONF_SUBDIRS="tests/cdemo tests/demo tests/depdemo tests/f77demo tests/fcdemo \
167         tests/mdemo tests/mdemo2 tests/pdemo tests/tagdemo"
168 AC_SUBST([CONF_SUBDIRS])
169
170 DIST_MAKEFILE_LIST=
171 for dir in $CONF_SUBDIRS; do
172   DIST_MAKEFILE_LIST="${DIST_MAKEFILE_LIST}$dir/Makefile "
173 done
174 AC_SUBST([DIST_MAKEFILE_LIST])
175
176
177 ## ---------------- ##
178 ## compiler checks. ##
179 ## ---------------- ##
180
181 # Need to be sure that we have a working C compiler, otherwise even with
182 # a good C compiler: if the following C++ tests fail, the whole libtool
183 # build fails!
184 AC_PROG_CC
185 AM_PROG_CC_C_O
186 AC_PROG_CPP
187
188 ## ----------------------- ##
189 ## Libtool initialisation. ##
190 ## ----------------------- ##
191 LT_INIT([dlopen win32-dll])
192 _LT_SET_OPTION([LTDL_INIT], [nonrecursive])
193 _LTDL_SETUP
194
195 # Enable all the language support we can
196 LT_LANG(C++)
197 LT_LANG(Fortran 77)
198 LT_LANG(Fortran)
199 LT_LANG(Go)
200 LT_LANG(Java)
201 LT_LANG(Windows Resource)
202
203 # Ensure the correct file name (and path) conversion function
204 # is available to the test suite.
205 AC_SUBST([to_host_file_cmd])dnl
206 AC_SUBST([to_tool_file_cmd])dnl
207
208 ## --------------------------- ##
209 ## Work out which tests to run ##
210 ## --------------------------- ##
211 AM_CONDITIONAL(HAVE_CXX,[test -n "[$]_LT_TAGVAR(compiler, CXX)"])
212 AM_CONDITIONAL(HAVE_F77,[test -n "[$]_LT_TAGVAR(compiler, F77)"])
213 AM_CONDITIONAL(HAVE_FC,[test -n "[$]_LT_TAGVAR(compiler, FC)"])
214 AM_CONDITIONAL(HAVE_GCJ, [test -n "[$]_LT_TAGVAR(compiler, GCJ)"])
215 AM_CONDITIONAL(HAVE_RC, [test -n "[$]_LT_TAGVAR(compiler, RC)"])
216
217 ## Whether `make' supports order-only prerequisites.
218 AC_CACHE_CHECK([whether ${MAKE-make} supports order-only prerequisites],
219   [lt_cv_make_order_only],
220   [mkdir conftest.dir
221    cd conftest.dir
222    touch b
223    touch a
224 cat >confmk << 'END'
225 a: b | c
226 a b c:
227         touch $[]@
228 END
229    touch c
230    if ${MAKE-make} -s -q -f confmk >/dev/null 2>&1; then
231      lt_cv_make_order_only=yes
232    else
233      lt_cv_make_order_only=no
234    fi
235    cd ..
236    rm -rf conftest.dir
237 ])
238 if test $lt_cv_make_order_only = yes; then
239   ORDER='|'
240 else
241   ORDER=''
242 fi
243 AC_SUBST([ORDER])
244
245 ## ------------- ##
246 ## Documentation ##
247 ## ------------- ##
248 AM_MISSING_PROG([HELP2MAN], [help2man])
249
250 ## -------- ##
251 ## Outputs. ##
252 ## -------- ##
253 AC_CONFIG_FILES([Makefile])
254 AC_OUTPUT