isl.m4 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. # ISL_INIT_FLAGS ()
  20. # -------------------------
  21. # Provide configure switches for isl support.
  22. # Initialize isllibs/islinc according to the user input.
  23. AC_DEFUN([ISL_INIT_FLAGS],
  24. [
  25. AC_ARG_WITH([isl-include],
  26. [AS_HELP_STRING(
  27. [--with-isl-include=PATH],
  28. [Specify directory for installed isl include files])])
  29. AC_ARG_WITH([isl-lib],
  30. [AS_HELP_STRING(
  31. [--with-isl-lib=PATH],
  32. [Specify the directory for the installed isl library])])
  33. AC_ARG_ENABLE(isl-version-check,
  34. [AS_HELP_STRING(
  35. [--disable-isl-version-check],
  36. [disable check for isl version])],
  37. ENABLE_ISL_CHECK=$enableval,
  38. ENABLE_ISL_CHECK=yes)
  39. # Initialize isllibs and islinc.
  40. case $with_isl in
  41. no)
  42. isllibs=
  43. islinc=
  44. ;;
  45. "" | yes)
  46. ;;
  47. *)
  48. isllibs="-L$with_isl/lib"
  49. islinc="-I$with_isl/include"
  50. ;;
  51. esac
  52. if test "x${with_isl_include}" != x ; then
  53. islinc="-I$with_isl_include"
  54. fi
  55. if test "x${with_isl_lib}" != x; then
  56. isllibs="-L$with_isl_lib"
  57. fi
  58. dnl If no --with-isl flag was specified and there is in-tree isl
  59. dnl source, set up flags to use that and skip any version tests
  60. dnl as we cannot run them before building isl.
  61. if test "x${islinc}" = x && test "x${isllibs}" = x \
  62. && test -d ${srcdir}/isl; then
  63. isllibs='-L$$r/$(HOST_SUBDIR)/isl/'"$lt_cv_objdir"' '
  64. islinc='-I$$r/$(HOST_SUBDIR)/isl/include -I$$s/isl/include'
  65. ENABLE_ISL_CHECK=no
  66. AC_MSG_WARN([using in-tree isl, disabling version check])
  67. fi
  68. isllibs="${isllibs} -lisl"
  69. ]
  70. )
  71. # ISL_REQUESTED (ACTION-IF-REQUESTED, ACTION-IF-NOT)
  72. # ----------------------------------------------------
  73. # Provide actions for failed isl detection.
  74. AC_DEFUN([ISL_REQUESTED],
  75. [
  76. AC_REQUIRE([ISL_INIT_FLAGS])
  77. if test "x${with_isl}" = xno; then
  78. $2
  79. elif test "x${with_isl}" != x \
  80. || test "x${with_isl_include}" != x \
  81. || test "x${with_isl_lib}" != x ; then
  82. $1
  83. else
  84. $2
  85. fi
  86. ]
  87. )
  88. # ISL_CHECK_VERSION ISL_CHECK_VERSION ()
  89. # ----------------------------------------------------------------
  90. # Test whether isl contains functionality added to the minimum expected version.
  91. AC_DEFUN([ISL_CHECK_VERSION],
  92. [
  93. if test "${ENABLE_ISL_CHECK}" = yes ; then
  94. _isl_saved_CFLAGS=$CFLAGS
  95. _isl_saved_LDFLAGS=$LDFLAGS
  96. _isl_saved_LIBS=$LIBS
  97. CFLAGS="${_isl_saved_CFLAGS} ${islinc} ${gmpinc}"
  98. LDFLAGS="${_isl_saved_LDFLAGS} ${isllibs} ${gmplibs}"
  99. LIBS="${_isl_saved_LIBS} -lisl -lgmp"
  100. AC_MSG_CHECKING([for isl 0.15 or later])
  101. AC_TRY_LINK([#include <isl/schedule.h>],
  102. [isl_options_set_schedule_serialize_sccs (NULL, 0);],
  103. [gcc_cv_isl=yes],
  104. [gcc_cv_isl=no])
  105. AC_MSG_RESULT([$gcc_cv_isl])
  106. if test "${gcc_cv_isl}" = no ; then
  107. AC_MSG_RESULT([required isl version is 0.15 or later])
  108. fi
  109. CFLAGS=$_isl_saved_CFLAGS
  110. LDFLAGS=$_isl_saved_LDFLAGS
  111. LIBS=$_isl_saved_LIBS
  112. fi
  113. ]
  114. )
  115. # ISL_IF_FAILED (ACTION-IF-FAILED)
  116. # ----------------------------------
  117. # Executes ACTION-IF-FAILED, if GRAPHITE was requested and
  118. # the checks failed.
  119. AC_DEFUN([ISL_IF_FAILED],
  120. [
  121. ISL_REQUESTED([graphite_requested=yes], [graphite_requested=no])
  122. if test "${gcc_cv_isl}" = no ; then
  123. isllibs=
  124. islinc=
  125. fi
  126. if test "${graphite_requested}" = yes \
  127. && test "x${isllibs}" = x \
  128. && test "x${islinc}" = x ; then
  129. $1
  130. fi
  131. ]
  132. )