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 Richard Guenther <rguenther@suse.de>
21 # -------------------------
22 # Provide configure switches for ISL support.
23 # Initialize isllibs/islinc according to the user input.
24 AC_DEFUN([ISL_INIT_FLAGS],
26 AC_ARG_WITH([isl-include],
28 [--with-isl-include=PATH],
29 [Specify directory for installed ISL include files])])
30 AC_ARG_WITH([isl-lib],
32 [--with-isl-lib=PATH],
33 [Specify the directory for the installed ISL library])])
35 AC_ARG_ENABLE(isl-version-check,
37 [--disable-isl-version-check],
38 [disable check for ISL version])],
39 ENABLE_ISL_CHECK=$enableval,
42 # Initialize isllibs and islinc.
51 isllibs="-L$with_isl/lib"
52 islinc="-I$with_isl/include"
55 if test "x${with_isl_include}" != x ; then
56 islinc="-I$with_isl_include"
58 if test "x${with_isl_lib}" != x; then
59 isllibs="-L$with_isl_lib"
61 dnl If no --with-isl flag was specified and there is in-tree ISL
62 dnl source, set up flags to use that and skip any version tests
63 dnl as we cannot run them before building ISL.
64 if test "x${islinc}" = x && test "x${isllibs}" = x \
65 && test -d ${srcdir}/isl; then
66 isllibs='-L$$r/$(HOST_SUBDIR)/isl/'"$lt_cv_objdir"' '
67 islinc='-I$$r/$(HOST_SUBDIR)/isl/include -I$$s/isl/include'
69 AC_MSG_WARN([using in-tree ISL, disabling version check])
74 # ISL_REQUESTED (ACTION-IF-REQUESTED, ACTION-IF-NOT)
75 # ----------------------------------------------------
76 # Provide actions for failed ISL detection.
77 AC_DEFUN([ISL_REQUESTED],
79 AC_REQUIRE([ISL_INIT_FLAGS])
81 if test "x${with_isl}" = xno; then
83 elif test "x${with_isl}" != x \
84 || test "x${with_isl_include}" != x \
85 || test "x${with_isl_lib}" != x ; then
93 # _ISL_CHECK_CT_PROG(MAJOR, MINOR)
94 # --------------------------------------------
95 # Helper for verifying ISL compile time version.
96 m4_define([_ISL_CHECK_CT_PROG],[AC_LANG_PROGRAM(
97 [#include <isl/version.h>
99 [if (strncmp (isl_version (), "isl-$1.$2", strlen ("isl-$1.$2")) != 0)
103 # ISL_CHECK_VERSION ISL_CHECK_VERSION (MAJOR, MINOR)
104 # ----------------------------------------------------------------
105 # Test the found ISL to be exact of version MAJOR.MINOR and at least
107 AC_DEFUN([ISL_CHECK_VERSION],
109 if test "${ENABLE_ISL_CHECK}" = yes ; then
110 _isl_saved_CFLAGS=$CFLAGS
111 _isl_saved_LDFLAGS=$LDFLAGS
112 _isl_saved_LIBS=$LIBS
114 CFLAGS="${_isl_saved_CFLAGS} ${islinc} ${gmpinc}"
115 LDFLAGS="${_isl_saved_LDFLAGS} ${isllibs}"
116 LIBS="${_isl_saved_LIBS} -lisl"
118 AC_MSG_CHECKING([for version $1.$2 of ISL])
119 AC_RUN_IFELSE([_ISL_CHECK_CT_PROG($1,$2)],
123 AC_MSG_RESULT([$gcc_cv_isl])
125 CFLAGS=$_isl_saved_CFLAGS
126 LDFLAGS=$_isl_saved_LDFLAGS
127 LIBS=$_isl_saved_LIBS
132 # ISL_IF_FAILED (ACTION-IF-FAILED)
133 # ----------------------------------
134 # Executes ACTION-IF-FAILED, if GRAPHITE was requested and
136 AC_DEFUN([ISL_IF_FAILED],
138 ISL_REQUESTED([graphite_requested=yes], [graphite_requested=no])
140 if test "${gcc_cv_isl}" = no ; then
145 if test "${graphite_requested}" = yes \
146 && test "x${isllibs}" = x \
147 && test "x${islinc}" = x ; then