Support ifort on darwin.
[libtool.git] / configure.ac
blob9c181db7829df3c11ac242fe2f9106bb13c2d912
1 # Process this file with autoconf to create configure. -*- autoconf -*-
3 #   Copyright (C) 2001, 2004, 2005, 2008 Free Software Foundation, Inc.
4 #   Written by Gary V. Vaughan, 2001
6 #   This file is part of GNU Libtool.
8 # GNU Libtool is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; either version 2 of
11 # the License, or (at your option) any later version.
13 # GNU Libtool is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Libtool; see the file COPYING.  If not, a copy
20 # can be downloaded from  http://www.gnu.org/licenses/gpl.html,
21 # or obtained by writing to the Free Software Foundation, Inc.,
22 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 ####
26 AC_PREREQ(2.59)dnl We use AS_HELP_STRING
27 dnl Oldest automake required for bootstrap is below in AM_INIT_AUTOMAKE.
30 ## ------------------------ ##
31 ## Autoconf initialisation. ##
32 ## ------------------------ ##
33 AC_INIT([libtool], [2.2.5a], [bug-libtool@gnu.org])
34 AC_CONFIG_HEADERS([config.h:config-h.in])
35 AC_CONFIG_SRCDIR([libtoolize.in])
36 LT_CONFIG_LTDL_DIR([libltdl], [nonrecursive])
37 AC_CONFIG_AUX_DIR([libltdl/config])
38 AC_CONFIG_MACRO_DIR([libltdl/m4])
39 AC_CONFIG_LIBOBJ_DIR([libltdl])
42 ## ------------------------ ##
43 ## Autotest initialisation. ##
44 ## ------------------------ ##
46 AC_CONFIG_TESTDIR([tests])
47 AC_SUBST([AUTOM4TE], [${AUTOM4TE=autom4te}])
48 AC_SUBST([AUTOTEST], ['$(AUTOM4TE) --language=autotest'])
51 ## ---------------------------------------- ##
52 ## Display a configure time version banner. ##
53 ## ---------------------------------------- ##
55 # Calculating the previous version is somewhat involved, so do it once
56 # here, and SUBST the result for the maintainer release rules.  The
57 # versioning scheme we use is described here:
58 #       http://www.gnu.org/software/libtool/contribute.html
60 # First we break the version number up into its constituent parts.
61 lt_major=`echo "AC_PACKAGE_VERSION" | sed ['s,\..*$,,g']`
62 lt_minor=`echo "AC_PACKAGE_VERSION" | sed ['s,^[0-9]*\.\([0-9]*\).*$,\1,']`
63 lt_micro=`echo "AC_PACKAGE_VERSION" | sed ['s,^[0-9]*\.[0-9]*\(\.[0-9]*\).*$,\1,']`
64 lt_alpha=`echo "AC_PACKAGE_VERSION" | sed ['s,^[0-9.]*,,']`
66 test "$lt_minor" = "AC_PACKAGE_VERSION" && lt_minor=0
67 test "$lt_micro" = "AC_PACKAGE_VERSION" && lt_micro=""
69 # Then we try to work out what the release before this one would have been
70 # numbered.  The only time we come unstuck is when this is the first release
71 # from a stable branch (lt_micro=lt_alpha=""), so LASTRELEASE is the last
72 # release from the old stable branch, and we don't know what version that
73 # was, so leave it unset so that the Makefile can complain.
74 case $lt_alpha in
75   [[ab]])
76     case $lt_micro in
77       [.[01]])
78         LASTRELEASE="$lt_major.$lt_minor" ;;
79       *)
80         LASTRELEASE="$lt_major.$lt_minor$lt_micro" ;;
81     esac
82     ;;
83   [[cegikmoqsuwy]])
84     LASTRELEASE=`echo "AC_PACKAGE_VERSION" | tr 'c-y' 'b-w'` ;;
85   [[dfhjlnprtvxz]])
86     LASTRELEASE=`echo "AC_PACKAGE_VERSION" | tr 'd-z' 'b-x'` ;;
87   *) # No lt_alpha component
88     case $lt_micro in
89       .0)
90         LASTRELEASE="" ;;
91       .1)
92         LASTRELEASE="$lt_major.$lt_minor" ;;
93       .*)
94         lt_micro_value=`echo $lt_micro | sed 's,^\.,,'`
95         LASTRELEASE="$lt_major.$lt_minor.`expr $lt_micro_value - 1`" ;;
96       *)
97         LASTRELEASE="" ;;
98     esac
99     ;;
100 esac
101 AC_SUBST([LASTRELEASE])
103 # This is a sanity check so we can see which version is used in bug reports.
104 # It is assumed that we only want to see the date extension for cvs libtool
105 # versions (i.e. "odd" letters) and not actual alpha releases.
106 TIMESTAMP=`${CONFIG_SHELL} ${ac_aux_dir}/mkstamp ${srcdir}`
107 package_revision=`( set $TIMESTAMP; echo $1; )`
108 case $lt_alpha in
109   [[bdfhjlnprtvxz]])
110     TIMESTAMP=
111     ;;
112 esac
113 AS_BOX([Configuring AC_PACKAGE_TARNAME${TIMESTAMP:+" (Build:$TIMESTAMP)"} AC_PACKAGE_VERSION])
114 echo
115 AC_SUBST([TIMESTAMP])
116 AC_SUBST([package_revision])
119 ## ------------------------ ##
120 ## Automake Initialisation. ##
121 ## ------------------------ ##
123 dnl These are bootstrap requirements, once built, libtool may work with
124 dnl much older releases of autoconf and automake.  See release notes.
125 AM_INIT_AUTOMAKE([1.9 gnu subdir-objects dist-bzip2])
127 dnl We use m4sh to generate libtool's portable shell scripts
128 AC_SUBST([M4SH], ['$(AUTOM4TE) --language=m4sh'])
130 dnl Make sure config.status is regenerated when the version timestamp changes
131 AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/ChangeLog'])
133 dnl automake-1.9.x or autoconf-2.59 don't support subdir libobjs
134 AC_MSG_CHECKING([whether subdir libobjs are useable])
135 test -f $srcdir/argz.c || sublibobjs_supported=yes
136 AM_CONDITIONAL([LTDL_SUBDIR_LIBOBJS], test x"${sublibobjs_supported-no}" != xno)
137 AC_MSG_RESULT([${sublibobjs_supported-no}])
140 ## ------------------------------- ##
141 ## Libtool specific configuration. ##
142 ## ------------------------------- ##
144 dnl automake-1.9 does not substitute these two by default
145 AC_SUBST([abs_top_srcdir])
146 AC_SUBST([abs_top_builddir])
147 AC_SUBST([aclocaldir], ["\${datadir}/aclocal"])
148 AC_SUBST([pkgdatadir], ["\${datadir}/$PACKAGE"])
150 AC_ARG_ENABLE(ltdl-install,
151     [AS_HELP_STRING([--disable-ltdl-install], [do not install libltdl])])
152 if test x"${enable_ltdl_install+set}" != xset; then
153   enable_ltdl_install=yes
156 # All subdirectories that are configured on demand, but that must be
157 # included in the distribution.
158 CONF_SUBDIRS="tests/cdemo tests/demo tests/depdemo tests/f77demo tests/fcdemo \
159         tests/mdemo tests/mdemo2 tests/pdemo tests/tagdemo"
160 AC_SUBST([CONF_SUBDIRS])
162 DIST_MAKEFILE_LIST=
163 for dir in $CONF_SUBDIRS; do
164   DIST_MAKEFILE_LIST="${DIST_MAKEFILE_LIST}$dir/Makefile "
165 done
166 AC_SUBST([DIST_MAKEFILE_LIST])
169 ## ---------------- ##
170 ## compiler checks. ##
171 ## ---------------- ##
173 # Need to be sure that we have a working C compiler, otherwise even with
174 # a good C compiler: if the following C++ tests fail, the whole libtool
175 # build fails!
176 AC_PROG_CC
177 AM_PROG_CC_C_O
178 AC_PROG_CPP
180 ## ----------------------- ##
181 ## Libtool initialisation. ##
182 ## ----------------------- ##
183 LT_INIT([dlopen win32-dll])
184 _LT_SET_OPTION([LTDL_INIT], [nonrecursive])
185 _LTDL_SETUP
187 # Enable all the language support we can
188 LT_LANG(C++)
189 LT_LANG(Fortran 77)
190 LT_LANG(Fortran)
191 LT_LANG(Java)
192 LT_LANG(Windows Resource)
195 ## --------------------------- ##
196 ## Work out which tests to run ##
197 ## --------------------------- ##
198 AM_CONDITIONAL(HAVE_CXX,[test -n "[$]_LT_TAGVAR(compiler, CXX)"])
199 AM_CONDITIONAL(HAVE_F77,[test -n "[$]_LT_TAGVAR(compiler, F77)"])
200 AM_CONDITIONAL(HAVE_FC,[test -n "[$]_LT_TAGVAR(compiler, FC)"])
201 AM_CONDITIONAL(HAVE_GCJ, [test -n "[$]_LT_TAGVAR(compiler, GCJ)"])
202 AM_CONDITIONAL(HAVE_RC, [test -n "[$]_LT_TAGVAR(compiler, RC)"])
205 ## -------- ##
206 ## Outputs. ##
207 ## -------- ##
208 AC_CONFIG_FILES([Makefile])
209 AC_OUTPUT