2 dnl /*------------------------------------------------------------------+
4 dnl |------------------------------------------------------------------|
6 dnl |------------------------------------------------------------------|
7 dnl | First version: 18/10/2012 |
8 dnl +------------------------------------------------------------------+
10 dnl +------------------------------------------------------------------------+
12 dnl | Converter [osl <-> scoplib] |
14 dnl +------------------------------------------------------------------------+
15 dnl | Copyright (C) 2012 University of Paris-Sud |
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. |
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. |
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 |
32 dnl | Clay, the Chunky Loop Alteration wizardrY |
33 dnl | Written by Cedric Bastoul, Cedric.Bastoul@u-psud.fr |
34 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])
43 dnl Fill here the @bug email adress.
44 AC_INIT([converter], [version_major.version_minor.version_revision],
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
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 /**************************************************************************
60 dnl **************************************************************************/
63 dnl Checks for programs.
72 AC_CHECK_PROGS(DOXYGEN,doxygen,doxygen)
76 AX_CFLAGS_WARN_ALL(CFLAGS_WARN)
78 dnl Checks for typedefs, structures, and compiler characteristics.
82 dnl Checks for header files.
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 /**************************************************************************
96 dnl **************************************************************************/
98 gmp_flag="OSL_GMP_IS_HERE"
99 AX_SUBMODULE(gmp,no|system|build,system)
103 CPPFLAGS="-D$gmp_flag -I$with_gmp_builddir $CPPFLAGS"
104 LDFLAGS="-L$with_gmp_builddir/$lt_cv_objdir $LDFLAGS"
107 CPPFLAGS="-D$gmp_flag $CPPFLAGS"
108 if test "x$with_gmp_prefix" != "x"; then
109 CPPFLAGS="-I$with_gmp_prefix/include $CPPFLAGS"
112 if test "$with_gmp_exec_prefix" != "yes" ; then
113 LDFLAGS="-L$with_gmp_exec_prefix/lib $LDFLAGS"
119 AC_CHECK_HEADER(gmp.h,
121 [AC_MSG_ERROR("Can't find gmp headers.")])
124 [LIBS="$LIBS -lgmp"],
125 [AC_MSG_ERROR("Can't find gmp library.")])
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)
141 OSL_CPPFLAGS="-I$srcdir/osl/include -Iosl/include"
142 OSL_LIBS="$srcdir/osl/source/libosl.la"
145 OSL_CPPFLAGS="-I$osl_srcdir/include -I$with_osl_builddir/include"
146 OSL_LIBS="$with_osl_builddir/libosl.la"
149 if test "x$with_osl_prefix" != "x"; then
150 OSL_CPPFLAGS="-I$with_osl_prefix/include"
152 if test "x$with_osl_exec_prefix" != "x"; then
153 OSL_LDFLAGS="-L$with_osl_exec_prefix/lib"
155 OSL_LIBS="$with_osl_exec_prefix/lib/libosl.la -losl"
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
171 SCOPLIB_CPPFLAGS="-I$srcdir/scoplib/include -Iscoplib/include"
172 SCOPLIB_LIBS="$srcdir/scoplib/source/libscoplib.la"
175 SCOPLIB_CPPFLAGS="-I$scoplib_srcdir/include -I$with_scoplib_builddir/include"
176 SCOPLIB_LIBS="$with_scoplib_builddir/libscoplib.la"
179 if test "x$with_scoplib_prefix" != "x"; then
180 SCOPLIB_CPPFLAGS="-I$with_scoplib_prefix/include"
182 if test "x$with_scoplib_exec_prefix" != "x"; then
183 SCOPLIB_LDFLAGS="-L$with_scoplib_exec_prefix/lib"
185 SCOPLIB_LIBS="$with_scoplib_exec_prefix/lib/libscoplib.la -lscoplib"
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)
199 case "$with_candl" in
201 CANDL_CPPFLAGS="-I$srcdir/candl/include -Icandl/include"
202 CANDL_LIBS="$srcdir/candl/source/libcandl.la"
205 CANDL_CPPFLAGS="-I$candl_srcdir/include -I$with_candl_builddir/include"
206 CANDL_LIBS="$with_candl_builddir/libcandl.la"
209 if test "x$with_candl_prefix" != "x"; then
210 CANDL_CPPFLAGS="-I$with_candl_prefix/include"
212 if test "x$with_candl_exec_prefix" != "x"; then
213 CANDL_LDFLAGS="-L$with_candl_exec_prefix/lib"
215 CANDL_LIBS="$with_candl_exec_prefix/lib/libcandl.la -lcandl"
217 AM_CONDITIONAL(BUNDLED_CANDL, test $with_candl = bundled)
219 dnl /**************************************************************************
220 dnl * Substitutions *
221 dnl **************************************************************************/
224 dnl Substitutions to do.
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.
237 include/converter/macros.h
239 [test -z "$CONFIG_HEADERS" || echo timestamp > source/stamp-h.in])
241 if test $with_osl = bundled; then
242 AC_CONFIG_SUBDIRS(osl)
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)."