2 AC_INIT(source/backend.c)
3 AC_CONFIG_AUX_DIR(autoconf)
4 AC_CONFIG_MACRO_DIR([m4])
5 AM_INIT_AUTOMAKE(cloog-polylib, 0.16.3)
20 AX_CFLAGS_WARN_ALL(CFLAGS_WARN)
22 dnl Checks for typedefs, structures, and compiler characteristics.
26 dnl Checks for header files.
30 [AS_HELP_STRING([--with-bits=32|64|gmp],
31 [integer type to use])],
34 AX_SUBMODULE(cloog,build|bundled,bundled)
36 dnl /**************************************************************************
38 dnl **************************************************************************/
41 if test "$BITS" = "gmp"; then
42 gmp_module_default=system
44 AX_SUBMODULE(gmp,no|system,$gmp_module_default)
48 if test "x$with_gmp_prefix" != "x"; then
49 CPPFLAGS="-I$with_gmp_prefix/include $CPPFLAGS"
52 if test "$with_gmp_exec_prefix" != "yes" ; then
53 LDFLAGS="-L$with_gmp_exec_prefix/lib $LDFLAGS"
56 AC_CHECK_HEADER(gmp.h,
58 [AC_MSG_ERROR(Can't find gmp headers.)])
62 [AC_MSG_ERROR(Can't find gmp library.)])
63 AC_CHECK_DECLS(mp_get_memory_functions,[],[
64 need_get_memory_functions=true
68 AM_CONDITIONAL(NEED_GET_MEMORY_FUNCTIONS,
69 test x$need_get_memory_functions = xtrue)
71 dnl /**************************************************************************
72 dnl * Where is PolyLib? *
73 dnl **************************************************************************/
75 AX_SUBMODULE(polylib,system|build,system)
84 dnl Checking for PolyLib
85 AC_SUBST(cl_cv_polylib)
86 AC_SUBST(POLYLIB_CPPFLAGS)
87 AC_SUBST(POLYLIB_LDFLAGS)
88 AC_SUBST(POLYLIB_LIBS)
90 AC_MSG_CHECKING(for location of PolyLib)
91 if test "x$with_polylib_builddir" != "x"; then
92 with_polylib_builddir=`cd $with_polylib_builddir; pwd`
93 AC_MSG_RESULT(built in $with_polylib_builddir)
94 polylib_polylibs=`echo @polylibs@ | $with_polylib_builddir/config.status --file=-`
95 AC_MSG_NOTICE(Configured polylibs: $polylib_polylibs)
96 POLYLIB_CPPFLAGS="-I$with_polylib_builddir/include -I$polylib_srcdir/include"
97 for BITS in $polylibs; do
99 for PL in $polylib_polylibs; do
100 if test "libpolylib$BITS.la" = $PL; then
101 cl_cv_polylib="polylib$BITS"
105 if test "$cl_cv_polylib" != "missing"; then
106 POLYLIB_LIBS="$with_polylib_builddir/lib$cl_cv_polylib.la"
110 elif test "$with_polylib" != "no"; then
111 if test "x$with_polylib_prefix" != "x"; then
112 with_polylib_prefix=`cd $with_polylib_prefix; pwd`
113 AC_MSG_RESULT(installed in $with_polylib_exec_prefix)
114 POLYLIB_CPPFLAGS="-I$with_polylib_prefix/include"
115 POLYLIB_LDFLAGS="-L$with_polylib_exec_prefix/lib"
116 LD_LIBRARY_PATH="$with_polylib_exec_prefix/lib:$LD_LIBRARY_PATH"
117 export LD_LIBRARY_PATH
119 AC_MSG_RESULT(installed in standard location)
121 SAVE_CPPFLAGS="$CPPFLAGS"
122 SAVE_LDFLAGS="$LDFLAGS"
123 CPPFLAGS="$POLYLIB_CPPFLAGS $CPPFLAGS"
124 LDFLAGS="$POLYLIB_LDFLAGS $LDFLAGS"
125 for BITS in $polylibs; do
126 cl_cv_polylib="polylib$BITS"
127 AC_CHECK_HEADER(polylib/$cl_cv_polylib.h,[
128 AC_CHECK_LIB($cl_cv_polylib,PolyhedronTSort,[
129 POLYLIB_LIBS="-l$cl_cv_polylib"
133 cl_cv_polylib=missing
135 CPPFLAGS="$SAVE_CPPFLAGS"
136 LDFLAGS="$SAVE_LDFLAGS"
138 case "$cl_cv_polylib" in
140 AC_MSG_ERROR(Can't find PolyLib.)
144 dnl /**************************************************************************
145 dnl * Where is CLooG? *
146 dnl **************************************************************************/
148 AC_SUBST(CLOOG_SRCDIR)
149 AC_SUBST(CLOOG_BUILDDIR)
150 AC_SUBST(CLOOG_CPPFLAGS)
151 case "$with_cloog" in
153 CLOOG_SRCDIR="\$(top_srcdir)/cloog-core"
154 CLOOG_BUILDDIR="\$(top_builddir)/cloog-core"
158 case "$cloog_srcdir" in
160 CLOOG_SRCDIR=$cloog_srcdir
163 CLOOG_SRCDIR="\$(top_srcdir)/$cloog_srcdir"
165 case "$with_cloog_builddir" in
167 CLOOG_BUILDDIR=$with_cloog_builddir
170 CLOOG_BUILDDIR="\$(top_builddir)/$with_cloog_builddir"
174 CLOOG_CPPFLAGS="-I$CLOOG_SRCDIR/include -I$CLOOG_BUILDDIR -I$CLOOG_BUILDDIR/include"
175 AM_CONDITIONAL(BUNDLED_CLOOG, test $with_cloog = bundled)
183 AC_CHECK_SIZEOF(int,1)
184 AC_CHECK_SIZEOF(long,1)
185 AC_CHECK_SIZEOF(long long,1)
186 for cl_cv_int_type in int long long_long; do
187 eval "bits=\`expr \$ac_cv_sizeof_$cl_cv_int_type \* 8\`"
188 if test "$bits" = "$BITS"; then
194 AH_TEMPLATE(CLOOG_INT_INT)
195 AH_TEMPLATE(CLOOG_INT_LONG)
196 AH_TEMPLATE(CLOOG_INT_LONG_LONG)
197 AH_TEMPLATE(CLOOG_INT_GMP)
198 cloog_int_macro=AS_TR_CPP(CLOOG_INT_$cl_cv_int_type)
199 AC_DEFINE_UNQUOTED($cloog_int_macro)
202 dnl /**************************************************************************
203 dnl * Substitutions *
204 dnl **************************************************************************/
207 dnl Substitutions to do in Makefile.in.
212 AC_SUBST(exec_prefix)
217 PACKAGE_NAME="cloog-polylib"
218 PACKAGE_CFLAGS="-D$cloog_int_macro=1"
219 AX_CREATE_PKGCONFIG_INFO
221 AC_CONFIG_FILES(Makefile test/Makefile include/cloog/polylib/backend.h)
222 if test $with_cloog = bundled; then
223 AC_CONFIG_SUBDIRS(cloog-core)
225 AC_CONFIG_COMMANDS_POST([
227 for arg in $ac_configure_args; do
229 --with-polylib*|--with-isl*)
232 old_args="$old_args $arg"
236 ac_configure_args="$old_args --without-isl"
241 echo " /*-----------------------------------------------*"
242 echo " * CLooG configuration is OK *"
243 echo " *-----------------------------------------------*/"
244 echo "It appears that your system is OK to start CLooG compilation. You need"
245 echo "now to type \"make\". After compilation, you should check CLooG by typing"
246 echo "\"make check\". If no problem occur, you can type \"make uninstall\" if"
247 echo "you are upgrading an old version. Lastly type \"make install\" to install"
248 echo "CLooG on your system (log as root if necessary)."