Added support for statement extensions
[converter.git] / configure.ac
blobc8ac3aea761d2fb5d2a91dc6707c1618c78b2e19
1 dnl
2 dnl   /*------------------------------------------------------------------+
3 dnl    |                             Converter                            |
4 dnl    |------------------------------------------------------------------|
5 dnl    |                          autoconf.ac                             |
6 dnl    |------------------------------------------------------------------|
7 dnl    |                   First version: 18/10/2012                      |
8 dnl    +------------------------------------------------------------------+
9 dnl
10 dnl +------------------------------------------------------------------------+
11 dnl |                                                                        |
12 dnl |                                 Converter [osl <-> scoplib]            |
13 dnl |                                                                        |
14 dnl +------------------------------------------------------------------------+
15 dnl | Copyright (C) 2012 University of Paris-Sud                             |
16 dnl |                                                                        |
17 dnl | This library is free software; you can redistribute it and/or modify   |
18 dnl | it under the terms of the GNU Lesser General Public License as         |
19 dnl | published by the Free Software Foundation; either version 2.1 of the   |
20 dnl | License, or (at your option) any later version.                        |
21 dnl |                                                                        |
22 dnl | This library is distributed in the hope that it will be useful but     |
23 dnl | WITHOUT ANY WARRANTY; without even the implied warranty of             |
24 dnl | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU       |
25 dnl | Lesser General Public License for more details.                        |
26 dnl |                                                                        |
27 dnl | You should have received a copy of the GNU Lesser General Public       |
28 dnl | License along with this software; if not, write to the Free Software   |
29 dnl | Foundation, Inc., 51 Franklin Street, Fifth Floor,                     |
30 dnl | Boston, MA  02110-1301  USA                                            |
31 dnl |                                                                        |
32 dnl | Clay, the Chunky Loop Alteration wizardrY                              |
33 dnl | Written by Cedric Bastoul, Cedric.Bastoul@u-psud.fr                    |
34 dnl +------------------------------------------------------------------------*/
35 dnl
36 dnl Input file for autoconf to build a configuration shellscript.
38 m4_define([version_major], [0])
39 m4_define([version_minor], [0])
40 m4_define([version_revision], [1])
42 AC_PREREQ(2.53)
43 dnl Fill here the @bug email adress.
44 AC_INIT([converter], [version_major.version_minor.version_revision],
45         [taj.khan@inria.fr])
46 dnl A common file, which serve as a test.
47 AC_CONFIG_SRCDIR([include/converter/converter.h])
48 dnl Put as most as possible configuration files to an auxialiry
49 dnl directory.
50 AC_CONFIG_AUX_DIR(autoconf)
51 AC_CONFIG_MACRO_DIR([m4])
53 dnl Initialize automake.
54 AM_INIT_AUTOMAKE([foreign])
55 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
58 dnl /**************************************************************************
59 dnl  *                              Checking                                  *
60 dnl  **************************************************************************/
63 dnl Checks for programs.
64 AC_PROG_CC
65 AC_PROG_LN_S
66 AC_PROG_MAKE_SET
67 AC_CHECK_PROG(CD, cd)
68 AC_PROG_INSTALL
69 AC_PROG_LIBTOOL
70 AC_PROG_LEX
71 AC_PROG_YACC
72 AC_CHECK_PROGS(DOXYGEN,doxygen,doxygen)
73   
74 AX_CC_MAXOPT
75 AC_SUBST(CFLAGS_WARN)
76 AX_CFLAGS_WARN_ALL(CFLAGS_WARN)
78 dnl Checks for typedefs, structures, and compiler characteristics.
79 AC_C_CONST
80 AC_TYPE_SIZE_T
82 dnl Checks for header files.
83 AC_HEADER_STDC
84 AC_CHECK_HEADERS([errno.h stddef.h stdlib.h string.h strings.h unistd.h])
86 dnl Checks for library functions.
87 AC_CHECK_FUNCS(strtol)
90 dnl /**************************************************************************
91 dnl  *                             Option setting                             *
92 dnl  **************************************************************************/
94 dnl /**************************************************************************
95 dnl  *                            Where is GMP?                               *
96 dnl  **************************************************************************/
98 gmp_flag="OSL_GMP_IS_HERE"
99 AX_SUBMODULE(gmp,no|system|build,system)
101 case "$with_gmp" in
102 build)
103     CPPFLAGS="-D$gmp_flag -I$with_gmp_builddir $CPPFLAGS"
104     LDFLAGS="-L$with_gmp_builddir/$lt_cv_objdir $LDFLAGS"
105     ;;
106 system)
107     CPPFLAGS="-D$gmp_flag $CPPFLAGS"
108     if test "x$with_gmp_prefix" != "x"; then
109         CPPFLAGS="-I$with_gmp_prefix/include $CPPFLAGS"
110     fi
112     if test "$with_gmp_exec_prefix" != "yes" ; then
113         LDFLAGS="-L$with_gmp_exec_prefix/lib $LDFLAGS"
114     fi
115     ;;
116 esac
117 case "$with_gmp" in
118 build|system)
119     AC_CHECK_HEADER(gmp.h,
120                     [],
121                     [AC_MSG_ERROR("Can't find gmp headers.")])
122     AC_CHECK_LIB(gmp,
123                  __gmpz_init,
124                  [LIBS="$LIBS -lgmp"],
125                  [AC_MSG_ERROR("Can't find gmp library.")])
126     ;;
127 esac
130 dnl /**************************************************************************
131 dnl  *                   Where is the OpenScop Library?                       *
132 dnl  **************************************************************************/
134 AX_SUBMODULE(osl,system|build|bundled,bundled)
136 AC_SUBST(OSL_CPPFLAGS)
137 AC_SUBST(OSL_LDFLAGS)
138 AC_SUBST(OSL_LIBS)
139 case "$with_osl" in
140 bundled)
141         OSL_CPPFLAGS="-I$srcdir/osl/include -Iosl/include"
142         OSL_LIBS="$srcdir/osl/source/libosl.la"
143         ;;
144 build)
145         OSL_CPPFLAGS="-I$osl_srcdir/include -I$with_osl_builddir/include"
146         OSL_LIBS="$with_osl_builddir/libosl.la"
147         ;;
148 system)
149         if test "x$with_osl_prefix" != "x"; then
150                 OSL_CPPFLAGS="-I$with_osl_prefix/include"
151         fi
152         if test "x$with_osl_exec_prefix" != "x"; then
153                 OSL_LDFLAGS="-L$with_osl_exec_prefix/lib"
154         fi
155         OSL_LIBS="$with_osl_exec_prefix/lib/libosl.la -losl"
156 esac
157 AM_CONDITIONAL(BUNDLED_OSL, test $with_osl = bundled)
160 dnl /**************************************************************************
161 dnl  *                   Where is the Scoplib Library?                       *
162 dnl  **************************************************************************/
164 AX_SUBMODULE(scoplib,system|build|bundled,bundled)
166 AC_SUBST(SCOPLIB_CPPFLAGS)
167 AC_SUBST(SCOPLIB_LDFLAGS)
168 AC_SUBST(SCOPLIB_LIBS)
169 case "$with_scoplib" in
170 bundled)
171         SCOPLIB_CPPFLAGS="-I$srcdir/scoplib/include -Iscoplib/include"
172         SCOPLIB_LIBS="$srcdir/scoplib/source/libscoplib.la"
173         ;;
174 build)
175         SCOPLIB_CPPFLAGS="-I$scoplib_srcdir/include -I$with_scoplib_builddir/include"
176         SCOPLIB_LIBS="$with_scoplib_builddir/libscoplib.la"
177         ;;
178 system)
179         if test "x$with_scoplib_prefix" != "x"; then
180                 SCOPLIB_CPPFLAGS="-I$with_scoplib_prefix/include"
181         fi
182         if test "x$with_scoplib_exec_prefix" != "x"; then
183                 SCOPLIB_LDFLAGS="-L$with_scoplib_exec_prefix/lib"
184         fi
185         SCOPLIB_LIBS="$with_scoplib_exec_prefix/lib/libscoplib.la -lscoplib"
186 esac
187 AM_CONDITIONAL(BUNDLED_SCOPLIB, test $with_scoplib = bundled)
190 dnl /**************************************************************************
191 dnl  *                   Where is the Candl Library?                       *
192 dnl  **************************************************************************/
194 AX_SUBMODULE(candl,system|build|bundled,bundled)
196 AC_SUBST(CANDL_CPPFLAGS)
197 AC_SUBST(CANDL_LDFLAGS)
198 AC_SUBST(CANDL_LIBS)
199 case "$with_candl" in
200 bundled)
201         CANDL_CPPFLAGS="-I$srcdir/candl/include -Icandl/include"
202         CANDL_LIBS="$srcdir/candl/source/libcandl.la"
203         ;;
204 build)
205         CANDL_CPPFLAGS="-I$candl_srcdir/include -I$with_candl_builddir/include"
206         CANDL_LIBS="$with_candl_builddir/libcandl.la"
207         ;;
208 system)
209         if test "x$with_candl_prefix" != "x"; then
210                 CANDL_CPPFLAGS="-I$with_candl_prefix/include"
211         fi
212         if test "x$with_candl_exec_prefix" != "x"; then
213                 CANDL_LDFLAGS="-L$with_candl_exec_prefix/lib"
214         fi
215         CANDL_LIBS="$with_candl_exec_prefix/lib/libcandl.la -lcandl"
216 esac
217 AM_CONDITIONAL(BUNDLED_CANDL, test $with_candl = bundled)
219 dnl /**************************************************************************
220 dnl  *                            Substitutions                               *
221 dnl  **************************************************************************/
224 dnl Substitutions to do.
225 AC_SUBST(ac_aux_dir)
226 AC_SUBST(abs_top_srcdir)
228 AC_SUBST(VERSION_MAJOR)
229 AC_SUBST(VERSION_MINOR)
230 AC_SUBST(VERSION_REVISION)
232 dnl Configure Makefiles.
233 AC_CONFIG_FILES([
234         Makefile
235         doc/Makefile
236         doc/Doxyfile
237         include/converter/macros.h
238         ],
239         [test -z "$CONFIG_HEADERS" || echo timestamp > source/stamp-h.in])
241 if test $with_osl = bundled; then
242         AC_CONFIG_SUBDIRS(osl)
245 AC_OUTPUT
247 echo "             /*-----------------------------------------------+"
248 echo "              | Converter [osl<->scoplib]configuration is OK  |"
249 echo "              +-----------------------------------------------*/"
250 echo "It appears that your system is OK to start Conveter compilation. You need"
251 echo "now to type \"make\". Lastly type \"make install\" to install Clay on"
252 echo "your system (log as root if necessary)."