Properly handle function without arguments
[gcc.git] / config / isl.m4
index 0ddeddba9c24e6a067d205b36b5f8781cbeacb34..f45854d222bf7773d12d7f27037d38a709a68efd 100644 (file)
 # Initialize isllibs/islinc according to the user input.
 AC_DEFUN([ISL_INIT_FLAGS],
 [
-  AC_ARG_WITH(isl,
-    [AS_HELP_STRING(
-      [--with-isl=PATH],
-      [Specify prefix directory for the installed ISL package.
-       Equivalent to --with-isl-include=PATH/include
-       plus --with-isl-lib=PATH/lib])])
   AC_ARG_WITH([isl-include],
     [AS_HELP_STRING(
       [--with-isl-include=PATH],
@@ -72,19 +66,14 @@ AC_DEFUN([ISL_INIT_FLAGS],
     isllibs='-L$$r/$(HOST_SUBDIR)/isl/'"$lt_cv_objdir"' '
     islinc='-I$$r/$(HOST_SUBDIR)/isl/include -I$$s/isl/include'
     ENABLE_ISL_CHECK=no
+    AC_MSG_WARN([using in-tree ISL, disabling version check])
   fi
-
-  isllibs="${isllibs} -lisl"
-
-  dnl Flags needed for ISL
-  AC_SUBST(isllibs)
-  AC_SUBST(islinc)
 ]
 )
 
 # ISL_REQUESTED (ACTION-IF-REQUESTED, ACTION-IF-NOT)
 # ----------------------------------------------------
-# Provide actions for failed CLooG detection.
+# Provide actions for failed ISL detection.
 AC_DEFUN([ISL_REQUESTED],
 [
   AC_REQUIRE([ISL_INIT_FLAGS])
@@ -103,16 +92,13 @@ AC_DEFUN([ISL_REQUESTED],
 
 # _ISL_CHECK_CT_PROG(MAJOR, MINOR)
 # --------------------------------------------
-# Helper for verifying CLooG's compile time version.
+# Helper for verifying ISL compile time version.
 m4_define([_ISL_CHECK_CT_PROG],[AC_LANG_PROGRAM(
   [#include <isl/version.h>
    #include <string.h>],
-  [int main()
-   {
-     if (strncmp (isl_version (), "isl-0.10", strlen ("isl-$1.$2")) != 0)
-       return 1;
-     return 0;
-   }])])
+  [if (strncmp (isl_version (), "isl-$1.$2", strlen ("isl-$1.$2")) != 0)
+     return 1;
+   ])])
 
 # ISL_CHECK_VERSION ISL_CHECK_VERSION (MAJOR, MINOR)
 # ----------------------------------------------------------------
@@ -123,19 +109,22 @@ AC_DEFUN([ISL_CHECK_VERSION],
   if test "${ENABLE_ISL_CHECK}" = yes ; then
     _isl_saved_CFLAGS=$CFLAGS
     _isl_saved_LDFLAGS=$LDFLAGS
+    _isl_saved_LIBS=$LIBS
 
     CFLAGS="${_isl_saved_CFLAGS} ${islinc} ${gmpinc}"
-    LDFLAGS="${_isl_saved_LDFLAGS} ${isllibs} -lisl"
-    echo $CFLAGS
+    LDFLAGS="${_isl_saved_LDFLAGS} ${isllibs}"
+    LIBS="${_isl_saved_LIBS} -lisl"
 
-    AC_CACHE_CHECK([for version $1.$2 of ISL],
-      [gcc_cv_isl],
-      [AC_RUN_IFELSE([_ISL_CHECK_CT_PROG($1,$2)],
+    AC_MSG_CHECKING([for version $1.$2 of ISL])
+    AC_RUN_IFELSE([_ISL_CHECK_CT_PROG($1,$2)],
        [gcc_cv_isl=yes],
-       [gcc_cv_isl=no])])
+       [gcc_cv_isl=no],
+       [gcc_cv_isl=yes])
+    AC_MSG_RESULT([$gcc_cv_isl])
 
     CFLAGS=$_isl_saved_CFLAGS
     LDFLAGS=$_isl_saved_LDFLAGS
+    LIBS=$_isl_saved_LIBS
   fi
 ]
 )