2 dnl /*------------------------------------------------------------------+
4 dnl |------------------------------------------------------------------|
6 dnl |------------------------------------------------------------------|
7 dnl | First version: 03/04/2012 |
8 dnl +------------------------------------------------------------------+
10 dnl +------------------------------------------------------------------------+
11 dnl | / __)( ) /__\ ( \/ ) |
12 dnl | ( (__ )(__ /(__)\ \ / Chunky Loop Alteration wizardrY |
13 dnl | \___)(____)(__)(__)(__) |
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([clay], [version_major.version_minor.version_revision],
45 [cedric.bastoul@u-psud.fr])
46 dnl A common file, which serve as a test.
47 AC_CONFIG_SRCDIR([include/clay/clay.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])])
57 dnl /**************************************************************************
59 dnl **************************************************************************/
62 dnl Checks for programs.
71 AC_CHECK_PROGS(DOXYGEN,doxygen,doxygen)
75 AX_CFLAGS_WARN_ALL(CFLAGS_WARN)
77 dnl Checks for typedefs, structures, and compiler characteristics.
81 dnl Checks for header files.
83 AC_CHECK_HEADERS([errno.h stddef.h stdlib.h string.h strings.h unistd.h])
85 dnl Checks for library functions.
86 AC_CHECK_FUNCS(strtol)
89 dnl /**************************************************************************
90 dnl * Option setting *
91 dnl **************************************************************************/
93 dnl /**************************************************************************
94 dnl * Where is the OpenScop Library? *
95 dnl **************************************************************************/
97 AX_SUBMODULE(osl,system|build|bundled,system)
99 AC_SUBST(OSL_CPPFLAGS)
100 AC_SUBST(OSL_LDFLAGS)
104 OSL_CPPFLAGS="-I$srcdir/osl/include -Iosl/include"
105 OSL_LIBS="$srcdir/osl/libosl.la"
108 OSL_CPPFLAGS="-I$osl_srcdir/include -I$with_osl_builddir/include"
109 OSL_LIBS="$with_osl_builddir/libosl.la"
112 OSL_CPPFLAGS="-I$with_osl_prefix/include"
113 OSL_LIBS="$with_osl_prefix/lib/libosl.la -losl"
114 #if test "x$with_osl_exec_prefix" != "x"; then
115 # OSL_LDFLAGS="-L$with_osl_exec_prefix/lib"
118 AM_CONDITIONAL(BUNDLED_OSL, test $with_osl = bundled)
121 dnl /**************************************************************************
122 dnl * Where is Clan ? *
123 dnl **************************************************************************/
125 AX_SUBMODULE(clan,system|build|bundled|no,no)
127 AC_SUBST(CLAN_CPPFLAGS)
128 AC_SUBST(CLAN_LDFLAGS)
132 CLAN_CPPFLAGS="-I$srcdir/clan/include -Iclan/include -DCLAN_LINKED"
133 CLAN_LIBS="$srcdir/clan/libclan.la"
136 CLAN_CPPFLAGS="-I$clan_srcdir/include -I$with_clan_builddir/include -DCLAN_LINKED"
137 CLAN_LIBS="$with_clan_builddir/libclan.la"
140 CLAN_CPPFLAGS="-I$with_clan_prefix/include -DCLAN_LINKED"
141 CLAN_LIBS="$with_clan_prefix/lib/libclan.la -lclan"
142 # if test "x$with_clan_exec_prefix" != "x"; then
143 # CLAN_LDFLAGS="-L$with_clan_exec_prefix/lib"
146 AM_CONDITIONAL(BUNDLED_CLAN, test $with_clan = bundled)
149 dnl /**************************************************************************
150 dnl * Where is Cloog ? *
151 dnl **************************************************************************/
153 AX_SUBMODULE(cloog,system|build|bundled|no,no)
155 AC_SUBST(CLOOG_CPPFLAGS)
156 AC_SUBST(CLOOG_LDFLAGS)
158 case "$with_cloog" in
160 CLOOG_CPPFLAGS="-I$srcdir/cloog/include -Icloog/include -DCLOOG_LINKED"
161 CLOOG_LIBS="$srcdir/cloog/libcloog-isl.la"
164 CLOOG_CPPFLAGS="-I$cloog_srcdir/include -I$with_cloog_builddir/include -DCLOOG_LINKED"
165 CLOOG_LIBS="$with_cloog_builddir/libcloog-isl.la"
168 CLOOG_CPPFLAGS="-I$with_cloog_prefix/include -DCLOOG_LINKED"
169 CLOOG_LIBS="$with_cloog_prefix/lib/libcloog-isl.la -lcloog-isl"
170 # if test "x$with_cloog_exec_prefix" != "x"; then
171 # CLOOG_LDFLAGS="-L$with_cloog_exec_prefix/lib"
174 AM_CONDITIONAL(BUNDLED_CLOOG, test $with_cloog = bundled)
177 dnl /**************************************************************************
178 dnl * Where is Candl ? *
179 dnl **************************************************************************/
181 AX_SUBMODULE(candl,system|build|bundled|no,no)
183 AC_SUBST(CANDL_CPPFLAGS)
184 AC_SUBST(CANDL_LDFLAGS)
186 case "$with_candl" in
188 CANDL_CPPFLAGS="-I$srcdir/candl/include -Icandl/include -DCANDL_LINKED"
189 CANDL_LIBS="$srcdir/candl/libcandl.la"
192 CANDL_CPPFLAGS="-I$candl_srcdir/include -I$with_candl_builddir/include -DCANDL_LINKED"
193 CANDL_LIBS="$with_candl_builddir/libcandl.la"
196 CANDL_CPPFLAGS="-I$with_candl_prefix/include -DCANDL_LINKED"
197 CANDL_LIBS="$with_candl_prefix/lib/libcandl.la -lcandl"
198 # if test "x$with_candl_exec_prefix" != "x"; then
199 # CANDL_LDFLAGS="-L$with_candl_exec_prefix/lib"
202 AM_CONDITIONAL(BUNDLED_CANDL, test $with_candl = bundled)
205 dnl /**************************************************************************
206 dnl * Substitutions *
207 dnl **************************************************************************/
210 dnl Substitutions to do.
212 AC_SUBST(abs_top_srcdir)
214 AC_SUBST(VERSION_MAJOR)
215 AC_SUBST(VERSION_MINOR)
216 AC_SUBST(VERSION_REVISION)
218 dnl Configure Makefiles.
223 include/clay/macros.h
226 [test -z "$CONFIG_HEADERS" || echo timestamp > source/stamp-h.in])
228 if test $with_osl = bundled; then
229 AC_CONFIG_SUBDIRS(osl)
232 if test $with_clan = bundled; then
233 AC_CONFIG_SUBDIRS(clan)
236 if test $with_cloog = bundled; then
237 AC_CONFIG_SUBDIRS(cloog)
240 if test $with_candl = bundled; then
241 AC_CONFIG_SUBDIRS(candl)
246 echo " /*-----------------------------------------------+"
247 echo " | Clay configuration is OK |"
248 echo " +-----------------------------------------------*/"
249 echo "It appears that your system is OK to start Clay compilation. You need"
250 echo "now to type \"make\". Lastly type \"make install\" to install Clay on"
251 echo "your system (log as root if necessary)."