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