1 # This file is part of GCC.
3 # GCC is free software; you can redistribute it and/or modify it under
4 # the terms of the GNU General Public License as published by the Free
5 # Software Foundation; either version 3, or (at your option) any later
8 # GCC is distributed in the hope that it will be useful, but WITHOUT
9 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 # You should have received a copy of the GNU General Public License
14 # along with GCC; see the file COPYING3. If not see
15 # <http://www.gnu.org/licenses/>.
17 # Contributed by Andreas Simbuerger <simbuerg@fim.uni-passau.de>
20 # -------------------------
21 # Provide configure switches for CLooG support.
22 # Initialize clooglibs/clooginc according to the user input.
23 AC_DEFUN([CLOOG_INIT_FLAGS],
28 [Specify prefix directory for the installed CLooG-PPL package.
29 Equivalent to --with-cloog-include=PATH/include
30 plus --with-cloog-lib=PATH/lib])])
31 AC_ARG_WITH([cloog-include],
33 [--with-cloog-include=PATH],
34 [Specify directory for installed CLooG include files])])
35 AC_ARG_WITH([cloog-lib],
37 [--with-cloog-lib=PATH],
38 [Specify the directory for the installed CLooG library])])
40 AC_ARG_ENABLE(cloog-version-check,
42 [--disable-cloog-version-check],
43 [disable check for CLooG version])],
44 ENABLE_CLOOG_CHECK=$enableval,
45 ENABLE_CLOOG_CHECK=yes)
47 # Initialize clooglibs and clooginc.
56 clooglibs="-L$with_cloog/lib"
57 clooginc="-I$with_cloog/include"
60 if test "x${with_cloog_include}" != x ; then
61 clooginc="-I$with_cloog_include"
63 if test "x${with_cloog_lib}" != x; then
64 clooglibs="-L$with_cloog_lib"
66 dnl If no --with-cloog flag was specified and there is in-tree ClooG
67 dnl source, set up flags to use that.
68 if test "x${clooginc}" == x && test "x${clooglibs}" == x \
69 && test -d ${srcdir}/cloog; then
71 clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
72 clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -I'${srcdir}'/cloog/include '
75 clooginc="-DCLOOG_INT_GMP ${clooginc}"
76 clooglibs="${clooglibs} -lcloog-isl ${isllibs}"
78 dnl Flags needed for CLOOG
84 # CLOOG_REQUESTED (ACTION-IF-REQUESTED, ACTION-IF-NOT)
85 # ----------------------------------------------------
86 # Provide actions for failed CLooG detection.
87 AC_DEFUN([CLOOG_REQUESTED],
89 AC_REQUIRE([CLOOG_INIT_FLAGS])
91 if test "x${with_cloog}" = xno; then
93 elif test "x${with_cloog}" != x \
94 || test "x${with_cloog_include}" != x \
95 || test "x${with_cloog_lib}" != x ; then
103 # _CLOOG_CHECK_CT_PROG(MAJOR, MINOR, REVISION)
104 # --------------------------------------------
105 # Helper for verifying CLooG's compile time version.
106 m4_define([_CLOOG_CHECK_CT_PROG],[AC_LANG_PROGRAM(
107 [#include "cloog/version.h"],
108 [#if CLOOG_VERSION_MAJOR != $1 \
109 || CLOOG_VERSION_MINOR != $2 \
110 || CLOOG_VERSION_REVISION < $3
114 # CLOOG_CHECK_VERSION CLOOG_CHECK_VERSION (MAJOR, MINOR, REVISION)
115 # ----------------------------------------------------------------
116 # Test the found CLooG to be exact of version MAJOR.MINOR and at least
118 AC_DEFUN([CLOOG_CHECK_VERSION],
120 AC_REQUIRE([CLOOG_INIT_FLAGS])
122 if test "${ENABLE_CLOOG_CHECK}" = yes ; then
123 _cloog_saved_CFLAGS=$CFLAGS
124 _cloog_saved_LDFLAGS=$LDFLAGS
126 CFLAGS="${_cloog_saved_CFLAGS} ${clooginc} ${islinc} ${gmpinc}"
127 LDFLAGS="${_cloog_saved_LDFLAGS} ${clooglibs} ${isllibs} ${gmplib}"
129 AC_CACHE_CHECK([for version $1.$2.$3 of CLooG],
131 [AC_COMPILE_IFELSE([_CLOOG_CHECK_CT_PROG($1,$2,$3)],
135 CFLAGS=$_cloog_saved_CFLAGS
136 LDFLAGS=$_cloog_saved_LDFLAGS
141 # CLOOG_IF_FAILED (ACTION-IF-FAILED)
142 # ----------------------------------
143 # Executes ACTION-IF-FAILED, if GRAPHITE was requested and
145 AC_DEFUN([CLOOG_IF_FAILED],
147 CLOOG_REQUESTED([graphite_requested=yes], [graphite_requested=no])
149 if test "${gcc_cv_cloog}" = no ; then
154 if test "${graphite_requested}" = yes \
155 && test "x${clooglibs}" = x \
156 && test "x${clooginc}" = x ; then