update isl for change in space of isl_pw_* objects
[barvinok.git] / configure.ac
blob13e502b04a24b3b3a21bbaa28b00e862eb1ddaf6
1 AC_INIT([barvinok], [0.34], [isl-development@googlegroups.com])
2 AC_CONFIG_MACRO_DIR([m4])
3 AM_INIT_AUTOMAKE([foreign])
4 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
5 AC_PROG_CC
7 AC_PROG_CXX
8 AM_PROG_LEX
9 AC_PROG_YACC
10 AC_SUBST(versioninfo)
11 versioninfo=22:1:2
13 AC_CANONICAL_HOST
14 AC_LIBTOOL_WIN32_DLL
15 AC_SUBST(BV_LDFLAGS)
16 case $host in
17         *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
18         if test "$enable_shared" = yes; then
19                 BV_LDFLAGS="-no-undefined" 
20         fi
21         ;;
22 esac
24 AC_PROG_LIBTOOL
26 PKG_PROG_PKG_CONFIG
28 AC_CHECK_HEADERS(getopt.h)
29 AC_CHECK_HEADERS(sys/times.h)
30 AC_CHECK_FUNCS(sigaction)
32 AC_MSG_CHECKING(whether to build shared libbarvinok)
33 AC_ARG_ENABLE(shared_barvinok,
34         AS_HELP_STRING([--enable-shared-barvinok],
35                        [build shared barvinok library]),
36         [bv_cv_shared_barvinok=$enableval], [bv_cv_shared_barvinok="no"])
37 AC_MSG_RESULT($bv_cv_shared_barvinok)
38 if test "x$bv_cv_shared_barvinok" != "xyes" ; then
39         BV_LDFLAGS="$BV_LDFLAGS -static"
42 AC_CXX_GNUCXX_HASHMAP
44 AC_ARG_WITH(default-prefix,
45         AS_HELP_STRING([--with-default-prefix=DIR],
46             [Default installation prefix of optional packages]))
47 if test "${with_default_prefix+set}" = set; then
48         if test "${with_libgmp+set}" != set -a \
49            -f "$with_default_prefix/include/gmp.h"; then
50                 with_libgmp=$with_default_prefix
51         fi
52         if test "${with_ntl+set}" != set -a \
53            -f "$with_default_prefix/include/NTL/ZZ.h"; then
54                 with_ntl=$with_default_prefix
55         fi
56         if test "${with_cddlib+set}" != set -a \
57            -f "$with_default_prefix/include/cddmp.h"; then
58                 with_cddlib=$with_default_prefix
59         fi
60         if test "${with_glpk+set}" != set -a \
61            -f "$with_default_prefix/include/glpk.h"; then
62                 with_glpk=$with_default_prefix
63         fi
64         if test "${with_topcom+set}" != set -a \
65            -f "$with_default_prefix/bin/points2triangs"; then
66                 with_topcom=$with_default_prefix
67         fi
70 dnl Check for GMP library
71 AC_MSG_CHECKING(whether to use GMP)
72 AC_ARG_WITH(libgmp, 
73         [  --with-libgmp           DIR Location of the GMP Distribution], 
74         gmp_package=$withval, gmp_package=yes)
75 if test "x$gmp_package" = "xno"; then
76         AC_MSG_RESULT(no)
77         AC_MSG_ERROR(Need gmp)
78 else
79         AC_MSG_RESULT(yes)
80         if test "x$gmp_package" = "xyes"; then
81                 bv_configure_args="$bv_configure_args --with-libgmp --with-gmp"
82         else
83             bv_configure_args="$bv_configure_args --with-libgmp=$gmp_package"
84             bv_configure_args="$bv_configure_args --with-gmp-prefix=$gmp_package"
85             GMP_DIR=$gmp_package
86             if test ! -d "$GMP_DIR"; then
87                 AC_ERROR(Directory given for GMP Distribution is not a directory)
88             fi
89             CPPFLAGS="-I$GMP_DIR/include $CPPFLAGS"
90             LDFLAGS="-L$GMP_DIR/lib $LDFLAGS"
91         fi
92         poly_cv_gmpfatal="no"
93         AC_CHECK_HEADER(gmp.h,
94                 [AC_CHECK_LIB(gmp,main,
95                     [],
96                     [poly_cv_gmpfatal="yes"])],
97                 [poly_cv_gmpfatal="yes"])
98         if test "$poly_cv_gmpfatal" = "yes"; then
99                 AC_MSG_ERROR([GMP not found])
100         fi
102 AC_CHECK_DECL(mpz_divisible_p,[],[AC_LIBOBJ(mpz_divisible_p)],[#include <gmp.h>])
104 AX_SUBMODULE(polylib,build|bundled|system,bundled)
106 AC_SUBST(POLYLIB_CPPFLAGS)
107 AC_SUBST(POLYLIB_LDFLAGS)
108 AC_SUBST(POLYLIB_LIBS)
109 case "$with_polylib" in
110 bundled)
111         bv_configure_args="$bv_configure_args --with-polylib-builddir=../polylib"
112         POLYLIB_CPPFLAGS="-I\$(top_builddir)/polylib/include -I\$(top_srcdir)/polylib/include"
113         ;;
114 build)
115         with_polylib_builddir=`echo @abs_builddir@ | $with_polylib_builddir/config.status --file=-`
116         POLYLIB_CPPFLAGS="-I$polylib_srcdir/include -I$with_polylib_builddir/include"
117         POLYLIB_LIBS="$with_polylib_builddir/libpolylibgmp.la"
118         ;;
119 system)
120         POLYLIB_LIBS="-lpolylibgmp"
121         if test "x$with_polylib_prefix" != "x"; then
122                 POLYLIB_CPPFLAGS="-I$with_polylib_prefix/include"
123                 POLYLIB_LDFLAGS="-L$with_polylib_prefix/lib"
124         fi
125         SAVE_CPPFLAGS="$CPPFLAGS"
126         CPPFLAGS="$POLYLIB_CPPFLAGS $CPPFLAGS"
127         AC_CHECK_HEADERS([polylib/polylibgmp.h], [], [
128                 AC_MSG_ERROR(Need PolyLib)
129         ])
130         CPPFLAGS="$SAVE_CPPFLAGS"
131 esac
133 AM_CONDITIONAL(BUNDLED_POLYLIB, test $with_polylib = bundled)
135 AX_SUBMODULE(isl,build|bundled|system,bundled)
137 AC_SUBST(ISL_CFLAGS)
138 AC_SUBST(ISL_LIBS)
139 AC_SUBST(ISL_BUILDDIR)
140 case "$with_isl" in
141 bundled)
142         ISL_CFLAGS="-I\$(top_srcdir)/isl/include -I\$(top_builddir)/isl/include"
143         bv_configure_args="$bv_configure_args --with-isl-builddir=../isl"
144         PACKAGE_CFLAGS_ISL='-I${prefix}/include'
145         ;;
146 build)
147         ISL_BUILDDIR=`echo @abs_builddir@ | $with_isl_builddir/config.status --file=-`
148         bv_configure_args="$bv_configure_args --with-isl-builddir=$ISL_BUILDDIR"
149         ISL_CFLAGS="-I$isl_srcdir/include -I$ISL_BUILDDIR/include"
150         PACKAGE_CFLAGS_ISL='-I${prefix}/include'
151         ;;
152 system)
153         PKG_CHECK_MODULES([ISL], [isl])
154         PACKAGE_CFLAGS_ISL="$ISL_CFLAGS"
155 esac
156 AM_CONDITIONAL(BUNDLED_ISL, test $with_isl = bundled)
157 AM_CONDITIONAL(BUILD_ISL, test $with_isl = build)
159 AX_SUBMODULE(pet,bundled|build|system|no,no)
160 AC_SUBST(PET_CFLAGS)
161 AC_SUBST(PET_LIBS)
162 AC_SUBST(PET_BUILDDIR)
163 case "$with_pet" in
164 bundled)
165         PET_CFLAGS="-I\$(top_srcdir)/pet/include"
166         AC_DEFINE(HAVE_PET,[],[use Pet])
167         ;;
168 build)
169         PET_BUILDDIR=`echo @abs_builddir@ | $with_pet_builddir/config.status --file=-`
170         PET_CFLAGS="-I$pet_srcdir/include"
171         AC_DEFINE(HAVE_PET,[],[use Pet])
172         ;;
173 system)
174         PKG_CHECK_MODULES([PET], [pet])
175         AC_DEFINE(HAVE_PET,[],[use Pet])
176 esac
177 AM_CONDITIONAL(BUNDLED_PET, test $with_pet = bundled)
178 AM_CONDITIONAL(BUILD_PET, test $with_pet = build)
180 AX_SUBMODULE(isl-polylib,build|bundled|system,bundled)
182 AC_SUBST(ISL_POLYLIB_CFLAGS)
183 AC_SUBST(ISL_POLYLIB_LIBS)
184 case "$with_isl_polylib" in
185 bundled)
186         ISL_POLYLIB_CFLAGS="-I\$(top_srcdir)/isl-polylib/include -I\$(top_builddir)/isl-polylib/include"
187         ;;
188 build)
189         ISL_POLYLIB_CFLAGS="-I$isl_polylib_srcdir/include -I$with_isl_polylib_builddir/include"
190         ISL_POLYLIB_LIBS="$with_isl_polylib_builddir/libisl-polylib.la"
191         ;;
192 system)
193         PKG_CHECK_MODULES([ISL_POLYLIB], [isl-polylib])
194 esac
195 AM_CONDITIONAL(BUNDLED_ISL_POLYLIB, test $with_isl_polylib = bundled)
197 AC_MSG_CHECKING(if the fractional representation should be used)
198 AC_ARG_ENABLE(fractional, [AS_HELP_STRING([--disable-fractional],
199                                           [Don't use fractional representation])],
200             [bv_cv_fractional=$enableval], [bv_cv_fractional="yes"])
201 AC_ARG_ENABLE(modulo, [AS_HELP_STRING([--disable-modulo],
202                                       [Don't use fractional representation])],
203             [bv_cv_modulo=$enableval], [bv_cv_modulo="$bv_cv_fractional"])
204 AC_MSG_RESULT($bv_cv_modulo)
205 if test "x$bv_cv_modulo" != "xno" ; then
206         AC_DEFINE(USE_MODULO,[], [Use fractional representation])
209 AC_MSG_CHECKING(whether to use incremental algorithm)
210 AC_ARG_ENABLE(incremental,
211         [AS_HELP_STRING([--enable-incremental@<:@=bf|df@:>@],
212                         [Enable incremental algorithm [bf]])],
213         [bv_cv_incremental=$enableval], [bv_cv_incremental="no"])
214 AC_MSG_RESULT($bv_cv_incremental)
215 case $bv_cv_incremental in
216         yes | bf)
217                 AC_DEFINE(USE_INCREMENTAL_BF,[], 
218                           [Use breadth-first incremental algorithm])
219         ;;
220         df)
221                 AC_DEFINE(USE_INCREMENTAL_DF,[], 
222                           [Use depth-first incremental algorithm])
223         ;;
224 esac
226 AC_ARG_WITH(ntl,
227             [  --with-ntl=DIR          DIR Location of NTL],
228             [ echo "Package ntl : $withval" && ntl_package=$withval],  
229             [ ntl_package=yes ])
231 if test "$ntl_package" = "no"; then
232     AC_MSG_ERROR(Need ntl)
235 AC_SUBST(NTL_CPPFLAGS)
236 AC_SUBST(NTL_LDFLAGS)
237 if test "$ntl_package" != "yes"; then
238     NTL_CPPFLAGS="-I$ntl_package/include"
239     NTL_LDFLAGS="-L$ntl_package/lib"
242 SAVE_CPPFLAGS="$CPPFLAGS"
243 SAVE_LDFLAGS="$LDFLAGS"
244 CPPFLAGS="$NTL_CPPFLAGS $CPPFLAGS"
245 LDFLAGS="$NTL_LDFLAGS $LDFLAGS"
246 AC_LANG_PUSH(C++)
247 AC_EGREP_CPP(yes, [
248     #include <NTL/ZZ.h>
249     #ifdef NTL_GMP_LIP
250     yes
251     #endif
252     ],:,AC_MSG_ERROR(ntl not compiled with gmp support))
253 AC_LANG_POP
255 AC_CHECK_LIB(ntl, main,[],[
256     AC_MSG_ERROR(Need ntl)
258 CPPFLAGS="$SAVE_CPPFLAGS"
259 LDFLAGS="$SAVE_LDFLAGS"
261 AC_SUBST(bv_cone_hilbert_basis)
262 AC_MSG_CHECKING(whether to compile zsolve)
263 AC_ARG_WITH(zsolve,
264             [AS_HELP_STRING([--without-zsolve],[do not compile zsolve])],
265             [ with_zsolve=$withval],  [ with_zsolve=yes ])
266 AC_MSG_RESULT($with_zsolve)
268 use_zsolve=false
269 if test "$with_zsolve" != "no"; then
270         if test "$GCC" = "yes"; then
271                 $CC --version |
272                 sed -e 's/.* \(@<:@0-9@:>@@<:@0-9@:>@*\)\.\(@<:@0-9@:>@@<:@0-9@:>@*\).*/\1 \2/' |
273                 (read major minor
274                         if test $major -gt 3; then
275                                 exit 0
276                         fi
277                         if test $major -eq 3 -a $minor -ge 4; then
278                                 exit 0
279                         fi
280                         exit 1
281                 ) && use_zsolve=true
282         fi
283         if test "$use_zsolve" = false; then
284                 AC_MSG_WARN(gcc 3.4 required to compile zsolve)
285         else
286                 AC_DEFINE(USE_ZSOLVE,[],[use zsolve])
287                 bv_cone_hilbert_basis="cone_hilbert_basis\$(EXEEXT)"
288         fi
290 AM_CONDITIONAL(USE_ZSOLVE, test x$use_zsolve = xtrue)
292 AX_SUBMODULE(omega,no|bundled|system,no)
294 AC_SUBST(OMEGA_CPPFLAGS)
295 AC_SUBST(OMEGA_LDFLAGS)
296 AC_SUBST(OMEGA_LIBS)
297 AC_SUBST(OMEGA_CODEGEN_LIBS)
298 have_omega=false
299 have_codegen=false
300 case "$with_omega" in
301 bundled)
302         have_omega=true
303         have_codegen=true
304         OMEGA_CPPFLAGS="-I\$(top_srcdir)/omega/omega_lib/include"
305         OMEGA_CPPFLAGS="$OMEGA_CPPFLAGS -I\$(top_srcdir)/omega/basic/include"
306         OMEGA_CPPFLAGS="$OMEGA_CPPFLAGS -I\$(top_srcdir)/omega/code_gen/include"
307         OMEGA_CPPFLAGS="$OMEGA_CPPFLAGS -I\$(top_srcdir)/omega/omega_calc/include"
308         ;;
309 system)
310     if test "x$omega_package" != "xyes"; then
311         OMEGA_CPPFLAGS="-I$omega_package/include/omega"
312         OMEGA_LDFLAGS="-L$omega_package/lib"
313     else
314         for i in /usr/include /usr/local/include; do
315             if test -f $i/omega/omega.h; then
316                 OMEGA_CPPFLAGS="-I$i/omega"
317             fi
318         done
319     fi
321     AC_LANG_PUSH(C++)
322     SAVE_CPPFLAGS="$CPPFLAGS"
323     SAVE_LDFLAGS="$LDFLAGS"
324     CPPFLAGS="$OMEGA_CPPFLAGS $CPPFLAGS"
325     LDFLAGS="$OMEGA_LDFLAGS $LDFLAGS"
326     AC_CHECK_HEADERS([omega.h],[
327         OMEGA_LIBS="-lomega"
328         AC_CHECK_LIB(code_gen,main,[
329                 OMEGA_CODEGEN_LIBS="-lcode_gen -lomega"
330                 have_codegen=true
331         ])
332         have_omega=true
333     ],[AC_MSG_WARN(Omega not found)])
334     CPPFLAGS="$SAVE_CPPFLAGS"
335     LDFLAGS="$SAVE_LDFLAGS"
336     AC_LANG_POP
337     ;;
338 esac
339 if test "$have_omega" = true; then
340         AC_DEFINE(HAVE_OMEGA,[],[use omega])
342 AM_CONDITIONAL(HAVE_OMEGA, test x$have_omega = xtrue)
343 AM_CONDITIONAL(BUNDLED_OMEGA, test $with_omega = bundled)
345 use_parker=false
346 AC_MSG_CHECKING(whether to compile parker)
347 AC_ARG_WITH(parker,
348             [AS_HELP_STRING([--without-zsolve],[do not compile zsolve])],
349             [ with_parker=$withval],  [ with_parker=yes ])
350 AC_MSG_RESULT($with_parker)
352 if test "$with_parker" != "no"; then
353         AC_MSG_CHECKING(for mona)
354         AC_ARG_WITH(mona,
355                 [AS_HELP_STRING([--with-mona=DIR],[mona *source* directory])],
356                                 [], [AC_MSG_RESULT(not specified)])
358         if test "x$with_mona" != "x"; then
359                 AC_SUBST(MONAPATH)
360                 MONAPATH=$with_mona
361                 AC_MSG_RESULT($MONAPATH)
362                 use_parker=true
363                 AC_DEFINE(USE_PARKER,[],[use parker])
364         fi
366         if test "x$with_mona" = "x"; then
367                 AC_MSG_WARN(mona source directory required to compile parker)
368                 AC_MSG_WARN(http://www.brics.dk/mona/download)
369         fi
371 AM_CONDITIONAL(USE_PARKER, test x$use_parker = xtrue)
373 AC_MSG_CHECKING(whether to use cddlib)
374 AC_ARG_WITH(cddlib, [AS_HELP_STRING([--with-cddlib=DIR],[DIR Location of cddlib])],
375             [ cddlib_package=$withval],  [ cddlib_package=yes ])
376 AC_MSG_RESULT($cddlib_package)
378 have_cddlib=false
379 if test "$cddlib_package" != "no"; then
380     if test "x$cddlib_package" != "xyes"; then
381         CPPFLAGS="-I$cddlib_package/include $CPPFLAGS"
382         LDFLAGS="-L$cddlib_package/lib $LDFLAGS"
383     fi
384     AC_TRY_LINK([
385 #define GMPRATIONAL
386 #include <setoper.h>
387 #include <cddmp.h>
388 ], [
389     mytype a;
390     dd_init(a); ], [
391         have_cddlib=true
392         AC_CHECK_LIB(cddgmp, main,[
393                 SAVE_LIBS="$LIBS"
394                 LIBS="-lcddgmp $LIBS"
395                 AC_DEFINE_UNQUOTED([SRCDIR], ["$srcdir"], [srcdir])
396                 AC_LANG_PUSH(C++)
397                 AC_RUN_IFELSE(AC_LANG_PROGRAM([[#define GMPRATIONAL
398 #include <setoper.h>
399 #include <cdd.h>]],
400                 [[
401         const char *filename = SRCDIR"/cdd94e-test";
402         FILE *f;
403         dd_MatrixPtr M;
404         dd_LPType *lp;
405         dd_ErrorType err = dd_NoError;
407         dd_set_global_constants();
409         f = fopen(filename, "r");
410         M = dd_PolyFile2Matrix(f, &err);
411         lp = dd_Matrix2LP(M, &err);
412         dd_LPSolve(lp, dd_DualSimplex, &err);
413         return lp->LPS == dd_Inconsistent;
414                 ]]),[
415                         AC_DEFINE(HAVE_LIBCDDGMP, [], [Define to 1 if you have the `cddgmp' library (-lcddgmp).])
416                 ],[
417                         AC_MSG_WARN(please upgrade cddlib to 0.94e or later)
418                         LIBS="$SAVE_LIBS"
419                         have_cddlib=false
420                 ])
421                 AC_LANG_POP
422         ],[have_cddlib=false])
423     ])
425 AM_CONDITIONAL(HAVE_CDDLIB, test x$have_cddlib = xtrue)
429 AC_MSG_CHECKING(whether to use GLPK)
430 AC_ARG_WITH(glpk, [AS_HELP_STRING([--with-glpk=DIR],[DIR Location of GLPK])],
431             [ glpk_package=$withval],  [ glpk_package=yes ])
432 AC_MSG_RESULT($glpk_package)
434 have_glpk=false
435 if test "$glpk_package" != "no"; then
436     if test "x$glpk_package" != "xyes"; then
437         CPPFLAGS="-I$glpk_package/include $CPPFLAGS"
438         LDFLAGS="-L$glpk_package/lib $LDFLAGS"
439     fi
440     AC_CHECK_HEADERS([glpk.h],[
441         have_glpk=true
442         AC_CHECK_LIB(glpk, main,[],[have_glpk=false])
443     ])
445 AM_CONDITIONAL(HAVE_GLPK, test x$have_glpk = xtrue)
447 AC_MSG_CHECKING(location of TOPCOM)
448 AC_ARG_WITH(topcom, [AS_HELP_STRING([--with-topcom=DIR],[Location of TOPCOM])],
449             [topcom_package=$withval], [topcom_package=unspecified])
450 AC_MSG_RESULT($topcom_package)
451 have_topcom=false
452 if test "$topcom_package" != no; then
453         topcom_path="$PATH"
454         if test "$topcom_package" != unspecified; then
455                 topcom_path="$topcom_package/bin"
456         fi
457         AC_PATH_PROG([POINTS2TRIANGS], [points2triangs], [], [$topcom_path])
458         if test -n "$POINTS2TRIANGS"; then
459                 have_topcom=true
460                 AC_DEFINE_UNQUOTED(POINTS2TRIANGS_PATH, ["$POINTS2TRIANGS"],
461                                     [Path of points2triangs])
462         fi
464 AM_CONDITIONAL(HAVE_TOPCOM, test x$have_topcom = xtrue)
466 AX_SUBMODULE(cloog,no|build|bundled|system,bundled)
468 AC_SUBST(CLOOG_LDFLAGS)
469 AC_SUBST(CLOOG_CFLAGS)
470 AC_SUBST(CLOOG_LIBS)
471 CLOOG_CFLAGS="-DCLOOG_INT_GMP=1"
472 case "$with_cloog" in
473 bundled)
474         CLOOG_CFLAGS="$CLOOG_CFLAGS -I\$(top_srcdir)/cloog/include -I\$(top_builddir)/cloog/include"
475         AC_DEFINE(HAVE_CLOOG,[],[use CLooG])
476         ;;
477 build)
478         with_cloog_builddir=`echo @abs_builddir@ | $with_cloog_builddir/config.status --file=-`
479         CLOOG_CFLAGS="$CLOOG_CFLAGS -I$cloog_srcdir/include -I$with_cloog_builddir/include"
480         CLOOG_LIBS="$with_cloog_builddir/libcloog-isl.la"
481         AC_DEFINE(HAVE_CLOOG,[],[use CLooG])
482         ;;
483 system)
484         if test "x$with_cloog_prefix" != "x"; then
485                 CLOOG_CFLAGS="$CLOOG_CFLAGS -I$with_cloog_prefix/include"
486         fi
487         if test "x$with_cloog_exec_prefix" != "x"; then
488                 CLOOG_LDFLAGS="-L$with_cloog_exec_prefix/lib"
489         fi
490         CLOOG_LIBS="-lcloog-isl"
491         AC_DEFINE(HAVE_CLOOG,[],[use CLooG])
492 esac
493 AM_CONDITIONAL(BUNDLED_CLOOG, test $with_cloog = bundled)
495 AC_SUBST(GIT_HEAD_ID)
496 AC_SUBST(GIT_HEAD)
497 AC_SUBST(GIT_HEAD_VERSION)
498 if test -f $srcdir/.git/HEAD; then
499     GIT_HEAD="$srcdir/.git/index"
500     GIT_REPO="$srcdir/.git"
501     GIT_HEAD_ID=`GIT_DIR=$GIT_REPO git describe`
502 elif test -f $srcdir/GIT_HEAD_ID; then
503     GIT_HEAD_ID=`cat $srcdir/GIT_HEAD_ID`
504 else
505     mysrcdir=`(cd $srcdir; pwd)`
506     head=`basename $mysrcdir | sed -e 's/.*-//'`
507     head2=`echo $head | sed -e 's/[^0-9a-f]//'`
508     head3=`echo $head2 | sed -e 's/........................................//'`
509     base=`basename $mysrcdir | sed -e 's/-.*//'`
510     if test "x$head3" = "x" -a "x$head" = "x$head2"; then
511         GIT_HEAD_ID="barvinok-$VERSION-$head
512     elif test "x$base" = "xbarvinok-$VERSION" -a "x$head" != "x"; then
513         GIT_HEAD_ID="barvinok-$VERSION-$head
514     else
515         GIT_HEAD_ID="UNKNOWN"
516     fi
518 if test -z "$GIT_REPO" ; then
519     GIT_HEAD_VERSION="$GIT_HEAD_ID"
520 else
521     GIT_HEAD_VERSION="\`GIT_DIR=$GIT_REPO git describe\`"
523 echo '#define GIT_HEAD_ID "'$GIT_HEAD_ID'"' > version.h
525 AC_LANG_PUSH(C++)
526 AC_TRY_COMPILE([
527                 #include <set>
528                 void negate();
529         ], [negate()],
530         suffix="normal", suffix="broken")
531 AC_CONFIG_COMMANDS([barvinok/set.h],
532                    [cp $srcdir/barvinok/set.h.$suffix barvinok/set.h],
533                    [suffix="$suffix"])
534 AC_CONFIG_COMMANDS([barvinok/NTL.h],
535                    [cp $srcdir/barvinok/NTL.h.$suffix barvinok/NTL.h],
536                    [suffix="$suffix"])
537 use_fdstream=false
538 SAVE_CPPFLAGS="$CPPFLAGS"
539 CPPFLAGS="-I$srcdir $CPPFLAGS"
540 AC_TRY_COMPILE([#include "fdstream.h"],[],
541         [AC_DEFINE(USE_FDSTREAM,[],[use fdstream])
542         use_fdstream=true])
543 CPPFLAGS="$SAVE_CPPFLAGS"
544 AC_LANG_POP
545 AM_CONDITIONAL(USE_FDSTREAM, [test "$use_fdstream" = true])
547 PACKAGE_CFLAGS="$PACKAGE_CFLAGS_ISL"
548 PACKAGE_LIBS="-lbarvinok $EXTRA_PACKAGE_LIBS -lisl-polylib -lpolylibgmp -lisl"
549 AX_CREATE_PKGCONFIG_INFO
551 AC_CONFIG_HEADERS(config.h)
552 AC_CONFIG_FILES(Makefile zsolve/Makefile doc/Makefile)
553 AC_CONFIG_FILES(parker/Makefile)
554 if test $with_polylib = bundled; then
555         AC_CONFIG_SUBDIRS(polylib)
557 if test $with_isl = bundled; then
558         AC_CONFIG_SUBDIRS(isl)
560 if test $with_pet = bundled; then
561         AC_CONFIG_SUBDIRS(pet)
563 if test $with_isl_polylib = bundled; then
564         AC_CONFIG_SUBDIRS(isl-polylib)
566 if test $with_cloog = bundled; then
567         AC_CONFIG_SUBDIRS(cloog)
569 if test $with_omega = bundled; then
570         AC_CONFIG_SUBDIRS(omega)
572 AC_CONFIG_COMMANDS_POST([
573         dnl pass on arguments to subdir configures, but don't
574         dnl add them to config.status
575         ac_configure_args="$ac_configure_args $bv_configure_args"
577 AC_OUTPUT