summaryrefslogtreecommitdiff
path: root/cloog-0.16.3/configure.ac
blob: 053685ae726374ee83dcfff2d11d10f996c2cdb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222

dnl /**-------------------------------------------------------------------**
dnl  **                              CLooG                                **
dnl  **-------------------------------------------------------------------**
dnl  **                           configure.ac                            **
dnl  **-------------------------------------------------------------------**
dnl  **                   First version: august 7th 2002                  **
dnl  **-------------------------------------------------------------------**/
dnl
dnl Input file for autoconf to build a configuration shellscript.
dnl To build the configure script from the CLooG's top-level directory, use
dnl autoconf -l autoconf autoconf/configure.in > configure
dnl if it doesn't work (invalid option -l) try -I instead
dnl autoconf -I autoconf autoconf/configure.in > configure

dnl /**************************************************************************
dnl *               CLooG : the Chunky Loop Generator (experimental)          *
dnl ***************************************************************************
dnl *                                                                         *
dnl * Copyright (C) 2001 Cedric Bastoul                                       *
dnl *                                                                         *
dnl * This library is free software; you can redistribute it and/or           *
dnl * modify it under the terms of the GNU Lesser General Public              *
dnl * License as published by the Free Software Foundation; either            *
dnl * version 2.1 of the License, or (at your option) any later version.      *
dnl *                                                                         *
dnl * This library is distributed in the hope that it will be useful,         *
dnl * but WITHOUT ANY WARRANTY; without even the implied warranty of          *
dnl * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU       *
dnl * Lesser General Public License for more details.                         *
dnl *                                                                         *
dnl * You should have received a copy of the GNU Lesser General Public        *
dnl * License along with this library; if not, write to the Free Software     *
dnl * Foundation, Inc., 51 Franklin Street, Fifth Floor,                      *
dnl * Boston, MA  02110-1301  USA                                             *
dnl *                                                                         *
dnl * CLooG, the Chunky Loop Generator                                        *
dnl * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr                      *
dnl *                                                                         *
dnl ***************************************************************************/

m4_define([version_major], [0])
m4_define([version_minor], [16])
m4_define([version_revision], [3])

AC_PREREQ(2.53)
AC_INIT([cloog], [version_major.version_minor.version_revision],
	[cloog-development@googlegroups.com])
AC_CONFIG_SRCDIR(source/cloog.c)
AC_CONFIG_AUX_DIR(autoconf)
AC_CONFIG_MACRO_DIR([m4])

VERSION_MAJOR=version_major
VERSION_MINOR=version_minor
VERSION_REVISION=version_revision
AC_SUBST(versioninfo)
versioninfo=2:0:0

AM_INIT_AUTOMAKE([foreign])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

dnl /**************************************************************************
dnl  *                              Checking                                  *
dnl  **************************************************************************/

dnl Checks for programs.
AC_PROG_CC
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_CHECK_PROG(CD, cd)
dnl Configure needs an empty install.sh file with this, i HATE that...
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, [])
AM_CONDITIONAL(HAVE_TEXI2DVI, test -n "$TEXI2DVI")

AX_CC_MAXOPT
AC_SUBST(CFLAGS_WARN)
AX_CFLAGS_WARN_ALL(CFLAGS_WARN)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T



dnl Checks for header files.
AC_HEADER_STDC


dnl Checks for library functions.
AC_CHECK_FUNCS(strtol)


dnl /**************************************************************************
dnl  *                             Option setting                             *
dnl  **************************************************************************/

AC_CHECK_HEADERS([sys/resource.h],
	[AC_DEFINE([CLOOG_RUSAGE], [], [Print time required to generate code])])

AX_SUBMODULE(isl,no|system|build|bundled,bundled)
BITS="gmp"

dnl /**************************************************************************
dnl  *                            Where is GMP?                               *
dnl  **************************************************************************/

AX_SUBMODULE(gmp,system,system)

need_get_memory_functions=false
case "$with_gmp" in
system)
    if test "x$with_gmp_prefix" != "x"; then
	CPPFLAGS="-I$with_gmp_prefix/include $CPPFLAGS"
    fi
    
    if test "$with_gmp_exec_prefix" != "yes" ; then
	LDFLAGS="-L$with_gmp_exec_prefix/lib $LDFLAGS"
    fi
     
    AC_CHECK_HEADER(gmp.h,
                    [],
                    [AC_MSG_ERROR(Can't find gmp headers.)])
    AC_CHECK_LIB(gmp,
                 __gmpz_init,
                 [LIBS="$LIBS -lgmp"],
                 [AC_MSG_ERROR(Can't find gmp library.)])
    AC_CHECK_DECLS(mp_get_memory_functions,[],[
	    need_get_memory_functions=true
    ],[#include <gmp.h>])
    ;;
esac
AM_CONDITIONAL(NEED_GET_MEMORY_FUNCTIONS,
		test x$need_get_memory_functions = xtrue)

dnl /**************************************************************************
dnl  *                          Where is isl?                                 *
dnl  **************************************************************************/

AC_SUBST(ISL_CPPFLAGS)
AC_SUBST(ISL_LDFLAGS)
AC_SUBST(ISL_LIBS)
case "$with_isl" in
bundled)
	ISL_CPPFLAGS="-I$srcdir/isl/include -Iisl/include"
	;;
build)
	ISL_CPPFLAGS="-I$isl_srcdir/include -I$with_isl_builddir/include"
	ISL_LIBS="$with_isl_builddir/libisl.la"
	;;
system)
	if test "x$with_isl_prefix" != "x"; then
		ISL_CPPFLAGS="-I$with_isl_prefix/include"
	fi
	if test "x$with_isl_exec_prefix" != "x"; then
		ISL_LDFLAGS="-L$with_isl_exec_prefix/lib"
	fi
	ISL_LIBS="-lisl"
esac
AM_CONDITIONAL(BUNDLED_ISL, test $with_isl = bundled)
AM_CONDITIONAL(NO_ISL, test $with_isl = no)


AC_DEFINE([CLOOG_INT_GMP], 1, [Use arbitrary precision integers])

AC_SUBST(GIT_INDEX)
if test -f $srcdir/.git/HEAD; then
	GIT_INDEX="\$(top_srcdir)/.git/index"
fi


dnl /**************************************************************************
dnl  *                            Substitutions                               *
dnl  **************************************************************************/


dnl Substitutions to do in Makefile.in.
AC_SUBST(CC)
AC_SUBST(LN_S)

AC_SUBST(prefix)
AC_SUBST(exec_prefix)
AC_SUBST(INSTALL)

AC_SUBST(BITS)

AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_MINOR)
AC_SUBST(VERSION_REVISION)

PACKAGE_NAME="cloog-isl"
PACKAGE_CFLAGS="-DCLOOG_INT_GMP=1"
AX_CREATE_PKGCONFIG_INFO

AC_CONFIG_FILES(Makefile test/Makefile)
AC_CONFIG_FILES(autoconf/Doxyfile)
AC_CONFIG_FILES(doc/Makefile)
AC_CONFIG_FILES(source/version.c)
AC_CONFIG_FILES(include/cloog/version.h)
AC_CONFIG_FILES([genversion.sh], [chmod +x genversion.sh])
AC_CONFIG_COMMANDS([version.h],
	[echo '#define CLOOG_HEAD "'`./genversion.sh`'"' > version.h])
AC_CONFIG_COMMANDS([doc/gitversion.texi],
	[echo '@set VERSION '`./genversion.sh`'' > doc/gitversion.texi])
if test $with_isl = bundled; then
	AC_CONFIG_SUBDIRS(isl)
fi
AC_CONFIG_COMMANDS_POST([
	ac_configure_args="$ac_configure_args $cloog_configure_args"
])
AC_OUTPUT


echo "             /*-----------------------------------------------*"
echo "              *           CLooG configuration is OK           *"
echo "              *-----------------------------------------------*/"
echo "It appears that your system is OK to start CLooG compilation. You need"
echo "now to type \"make\". After compilation, you should check CLooG by typing"
echo "\"make check\". If no problem occur, you can type \"make uninstall\" if"
echo "you are upgrading an old version. Lastly type \"make install\" to install"
echo "CLooG on your system (log as root if necessary)."