]> git.ipfire.org Git - thirdparty/gcc.git/blame - config/isl.m4
re PR target/78478 (Compile Error for i386-rtems)
[thirdparty/gcc.git] / config / isl.m4
CommitLineData
4dacb1ad
RB
1# This file is part of GCC.
2#
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
6# version.
7#
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
11# for more details.
12#
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/>.
16#
17# Contributed by Richard Guenther <rguenther@suse.de>
18# Based on cloog.m4
19
20# ISL_INIT_FLAGS ()
21# -------------------------
560d18d3 22# Provide configure switches for isl support.
4dacb1ad
RB
23# Initialize isllibs/islinc according to the user input.
24AC_DEFUN([ISL_INIT_FLAGS],
25[
4dacb1ad
RB
26 AC_ARG_WITH([isl-include],
27 [AS_HELP_STRING(
28 [--with-isl-include=PATH],
560d18d3 29 [Specify directory for installed isl include files])])
4dacb1ad
RB
30 AC_ARG_WITH([isl-lib],
31 [AS_HELP_STRING(
32 [--with-isl-lib=PATH],
560d18d3 33 [Specify the directory for the installed isl library])])
4dacb1ad
RB
34
35 AC_ARG_ENABLE(isl-version-check,
36 [AS_HELP_STRING(
37 [--disable-isl-version-check],
560d18d3 38 [disable check for isl version])],
4dacb1ad
RB
39 ENABLE_ISL_CHECK=$enableval,
40 ENABLE_ISL_CHECK=yes)
41
42 # Initialize isllibs and islinc.
43 case $with_isl in
44 no)
45 isllibs=
46 islinc=
47 ;;
48 "" | yes)
49 ;;
50 *)
51 isllibs="-L$with_isl/lib"
52 islinc="-I$with_isl/include"
53 ;;
54 esac
55 if test "x${with_isl_include}" != x ; then
56 islinc="-I$with_isl_include"
57 fi
58 if test "x${with_isl_lib}" != x; then
59 isllibs="-L$with_isl_lib"
60 fi
560d18d3 61 dnl If no --with-isl flag was specified and there is in-tree isl
4dacb1ad 62 dnl source, set up flags to use that and skip any version tests
560d18d3 63 dnl as we cannot run them before building isl.
4dacb1ad
RB
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'
68 ENABLE_ISL_CHECK=no
560d18d3 69 AC_MSG_WARN([using in-tree isl, disabling version check])
4dacb1ad 70 fi
eae1a5d4 71
eae1a5d4 72 isllibs="${isllibs} -lisl"
4dacb1ad
RB
73]
74)
75
76# ISL_REQUESTED (ACTION-IF-REQUESTED, ACTION-IF-NOT)
77# ----------------------------------------------------
560d18d3 78# Provide actions for failed isl detection.
4dacb1ad
RB
79AC_DEFUN([ISL_REQUESTED],
80[
81 AC_REQUIRE([ISL_INIT_FLAGS])
82
83 if test "x${with_isl}" = xno; then
84 $2
85 elif test "x${with_isl}" != x \
86 || test "x${with_isl_include}" != x \
87 || test "x${with_isl_lib}" != x ; then
88 $1
89 else
90 $2
91 fi
92]
93)
94
e0c0c325 95# ISL_CHECK_VERSION ISL_CHECK_VERSION ()
4dacb1ad 96# ----------------------------------------------------------------
e357a5e0 97# Test whether isl contains functionality added to the minimum expected version.
4dacb1ad
RB
98AC_DEFUN([ISL_CHECK_VERSION],
99[
100 if test "${ENABLE_ISL_CHECK}" = yes ; then
101 _isl_saved_CFLAGS=$CFLAGS
102 _isl_saved_LDFLAGS=$LDFLAGS
90d4f233 103 _isl_saved_LIBS=$LIBS
4dacb1ad
RB
104
105 CFLAGS="${_isl_saved_CFLAGS} ${islinc} ${gmpinc}"
70decafb
NS
106 LDFLAGS="${_isl_saved_LDFLAGS} ${isllibs} ${gmplibs}"
107 LIBS="${_isl_saved_LIBS} -lisl -lgmp"
4dacb1ad 108
c661a43d 109 AC_MSG_CHECKING([for isl 0.16, 0.15, or deprecated 0.14])
560d18d3
AK
110 AC_TRY_LINK([#include <isl/ctx.h>],
111 [isl_ctx_get_max_operations (isl_ctx_alloc ());],
112 [gcc_cv_isl=yes],
113 [gcc_cv_isl=no])
2869f0ff 114 AC_MSG_RESULT([$gcc_cv_isl])
4dacb1ad 115
560d18d3 116 if test "${gcc_cv_isl}" = no ; then
c661a43d 117 AC_MSG_RESULT([recommended isl version is 0.16 or 0.15, the minimum required isl version 0.14 is deprecated])
560d18d3
AK
118 fi
119
c661a43d 120 AC_MSG_CHECKING([for isl 0.16 or 0.15])
1e050c90
AK
121 AC_TRY_LINK([#include <isl/schedule.h>],
122 [isl_options_set_schedule_serialize_sccs (NULL, 0);],
123 [ac_has_isl_options_set_schedule_serialize_sccs=yes],
124 [ac_has_isl_options_set_schedule_serialize_sccs=no])
125 AC_MSG_RESULT($ac_has_isl_options_set_schedule_serialize_sccs)
126
127 if test x"$ac_has_isl_options_set_schedule_serialize_sccs" = x"yes"; then
128 islver="0.15"
129 AC_SUBST([islver])
130 fi
131
4dacb1ad
RB
132 CFLAGS=$_isl_saved_CFLAGS
133 LDFLAGS=$_isl_saved_LDFLAGS
90d4f233 134 LIBS=$_isl_saved_LIBS
4dacb1ad
RB
135 fi
136]
137)
138
139# ISL_IF_FAILED (ACTION-IF-FAILED)
140# ----------------------------------
141# Executes ACTION-IF-FAILED, if GRAPHITE was requested and
142# the checks failed.
143AC_DEFUN([ISL_IF_FAILED],
144[
145 ISL_REQUESTED([graphite_requested=yes], [graphite_requested=no])
146
147 if test "${gcc_cv_isl}" = no ; then
148 isllibs=
149 islinc=
150 fi
151
152 if test "${graphite_requested}" = yes \
153 && test "x${isllibs}" = x \
154 && test "x${islinc}" = x ; then
155 $1
156 fi
157]
158)