isl.m4 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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 that 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}"
  99. LIBS="${_isl_saved_LIBS} -lisl"
  100. AC_MSG_CHECKING([for compatible ISL])
  101. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <isl/val.h>]], [[;]])],
  102. [gcc_cv_isl=yes],
  103. [gcc_cv_isl=no])
  104. AC_MSG_RESULT([$gcc_cv_isl])
  105. CFLAGS=$_isl_saved_CFLAGS
  106. LDFLAGS=$_isl_saved_LDFLAGS
  107. LIBS=$_isl_saved_LIBS
  108. fi
  109. ]
  110. )
  111. # ISL_IF_FAILED (ACTION-IF-FAILED)
  112. # ----------------------------------
  113. # Executes ACTION-IF-FAILED, if GRAPHITE was requested and
  114. # the checks failed.
  115. AC_DEFUN([ISL_IF_FAILED],
  116. [
  117. ISL_REQUESTED([graphite_requested=yes], [graphite_requested=no])
  118. if test "${gcc_cv_isl}" = no ; then
  119. isllibs=
  120. islinc=
  121. fi
  122. if test "${graphite_requested}" = yes \
  123. && test "x${isllibs}" = x \
  124. && test "x${islinc}" = x ; then
  125. $1
  126. fi
  127. ]
  128. )