diff options
author | Andreas Simbuerger <simbuerg@fim.uni-passau.de> | 2010-11-11 21:33:24 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2010-11-11 21:33:24 +0000 |
commit | d32ef397c98b50171cb13eb0421ace2479368eec (patch) | |
tree | 0513271428917e22045e1daa338c643489c93ef8 | |
parent | 77b0efff1d56d9579cb964b5f34a5eaddf146715 (diff) | |
download | gcc-d32ef397c98b50171cb13eb0421ace2479368eec.zip gcc-d32ef397c98b50171cb13eb0421ace2479368eec.tar.gz gcc-d32ef397c98b50171cb13eb0421ace2479368eec.tar.bz2 |
Support official CLooG.org versions.
2010-11-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* configure.ac: Support official CLooG.org versions.
* configure: Regenerate.
* config/cloog.m4: New.
From-SVN: r166622
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | config/cloog.m4 | 252 | ||||
-rwxr-xr-x | configure | 301 | ||||
-rw-r--r-- | configure.ac | 83 |
4 files changed, 530 insertions, 112 deletions
@@ -1,3 +1,9 @@ +2010-11-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de> + + * configure.ac: Support official CLooG.org versions. + * configure: Regenerate. + * config/cloog.m4: New. + 2010-11-10 François Dumont <francois.cppdevs@free.fr> * MAINTAINERS (Write After Approval): Add myself. diff --git a/config/cloog.m4 b/config/cloog.m4 new file mode 100644 index 0000000..9ddea98 --- /dev/null +++ b/config/cloog.m4 @@ -0,0 +1,252 @@ +# This file is part of GCC. +# +# GCC is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 3, or (at your option) any later +# version. +# +# GCC is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. +# +# Contributed by Andreas Simbuerger <simbuerg@fim.uni-passau.de> + +# CLOOG_INIT_FLAGS () +# ------------------------- +# Provide configure switches for CLooG support. +# Initialize clooglibs/clooginc according to the user input. +AC_DEFUN([CLOOG_INIT_FLAGS], +[ + AC_ARG_WITH(cloog, + [AS_HELP_STRING( + [--with-cloog=PATH], + [Specify prefix directory for the installed CLooG-PPL package. + Equivalent to --with-cloog-include=PATH/include + plus --with-cloog-lib=PATH/lib])]) + AC_ARG_WITH(cloog_include, + [AS_HELP_STRING( + [--with-cloog-include=PATH], + [Specify directory for installed CLooG include files])]) + AC_ARG_WITH(cloog_lib, + [AS_HELP_STRING( + [--with-cloog-lib=PATH], + [Specify the directory for the installed CLooG library])]) + + AC_ARG_ENABLE(cloog-version-check, + [AS_HELP_STRING( + [--disable-cloog-version-check], + [disable check for CLooG version])], + ENABLE_CLOOG_CHECK=$enableval, + ENABLE_CLOOG_CHECK=yes) + + # Initialize clooglibs and clooginc. + case $with_cloog in + no) + clooglibs= + clooginc= + ;; + "" | yes) + ;; + *) + clooglibs="-L$with_cloog/lib" + clooginc="-I$with_cloog/include" + ;; + esac + if test "x${with_cloog_include}" != x ; then + clooginc="-I$with_cloog_include" + fi + if test "x${with_cloog_lib}" != x; then + clooglibs="-L$with_cloog_lib" + fi + + dnl Flags needed for CLOOG + AC_SUBST(clooglibs) + AC_SUBST(clooginc) +] +) + +# CLOOG_REQUESTED (ACTION-IF-REQUESTED, ACTION-IF-NOT) +# ---------------------------------------------------- +# Provide actions for failed CLooG detection. +AC_DEFUN([CLOOG_REQUESTED], +[ + AC_REQUIRE([CLOOG_INIT_FLAGS]) + + if test "x${with_cloog}" != x \ + || test "x${with_cloog_include}" != x \ + || test "x${with_cloog_lib}" != x ; then + $1 + else + $2 + fi +] +) + +# _CLOOG_ORG_PROG () +# ------------------ +# Helper for detecting CLooG.org's backend. +m4_define([_CLOOG_ORG_PROG],[AC_LANG_PROGRAM( + [#include <cloog/cloog.h>], + [cloog_version ()])]) + +# _CLOOG_PPL_LEGACY_PROG () +# ------------------------- +# Helper for detecting CLooG-Legacy (CLooG-PPL). +m4_define([_CLOOG_PPL_LEGACY_PROG], [AC_LANG_PROGRAM( + [#include <cloog/cloog.h>], + [ppl_version_major ()])]) + +# CLOOG_FIND_FLAGS () +# ------------------ +# Detect the used CLooG-backend and set clooginc/clooglibs/cloog_org. +# Preference: CLooG-PPL (Legacy) > CLooG-ISL > CLooG-PPL +AC_DEFUN([CLOOG_FIND_FLAGS], +[ + AC_REQUIRE([CLOOG_INIT_FLAGS]) + + _cloog_saved_CFLAGS=$CFLAGS + _cloog_saved_CPPFLAGS=$CPPFLAGS + _cloog_saved_LDFLAGS=$LDFLAGS + _cloog_saved_LIBS=$LIBS + + _clooglegacyinc="-DCLOOG_PPL_BACKEND" + _cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG" + + dnl clooglibs & clooginc may have been initialized by CLOOG_INIT_FLAGS. + CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}" + CPPFLAGS="${CPPFLAGS} ${_clooglegacyinc} ${_cloogorginc}" + LDFLAGS="${LDFLAGS} ${clooglibs}" + + AC_CACHE_CHECK([for installed CLooG], + [gcc_cv_cloog_type], + [LIBS="-lcloog ${_cloog_saved_LIBS}" + AC_LINK_IFELSE([_CLOOG_PPL_LEGACY_PROG], + [gcc_cv_cloog_type="PPL Legacy"], + [LIBS="-lcloog-isl -lisl ${_cloog_saved_LIBS}" + AC_LINK_IFELSE([_CLOOG_ORG_PROG], + [gcc_cv_cloog_type=ISL], + [LIBS="-lcloog-ppl ${_cloog_saved_LIBS}" + AC_LINK_IFELSE([_CLOOG_ORG_PROG], + [gcc_cv_cloog_type=PPL], + [gcc_cv_cloog_type=no])])])]) + + case $gcc_cv_cloog_type in + "PPL Legacy") + clooginc="${clooginc} ${_clooglegacyinc}" + clooglibs="${clooglibs} -lcloog" + cloog_org=no + ;; + "ISL") + clooginc="${clooginc} ${_cloogorginc}" + clooglibs="${clooglibs} -lcloog-isl" + cloog_org=yes + ;; + "PPL") + clooginc="${clooginc} ${_cloogorginc}" + clooglibs="${clooglibs} -lcloog-ppl" + cloog_org=yes + ;; + *) + clooglibs= + clooginc= + cloog_org= + ;; + esac + + LIBS=$_cloog_saved_LIBS + CFLAGS=$_cloog_saved_CFLAGS + CPPFLAGS=$_cloog_saved_CPPFLAGS + LDFLAGS=$_cloog_saved_LDFLAGS +] +) + +# _CLOOG_CHECK_CT_PROG(MAJOR, MINOR, REVISION) +# -------------------------------------------- +# Helper for verifying CLooG's compile time version. +m4_define([_CLOOG_CHECK_CT_PROG],[AC_LANG_PROGRAM( + [#include "cloog/cloog.h"], + [#if CLOOG_VERSION_MAJOR != $1 \ + || CLOOG_VERSION_MINOR != $2 \ + || CLOOG_VERSION_REVISION < $3 + choke me + #endif])]) + +# _CLOOG_CHECK_RT_PROG () +# ----------------------- +# Helper for verifying that CLooG's compile time version +# matches the run time version. +m4_define([_CLOOG_CHECK_RT_PROG],[AC_LANG_PROGRAM( + [#include "cloog/cloog.h"], + [if ((cloog_version_major () != CLOOG_VERSION_MAJOR) + && (cloog_version_minor () != CLOOG_VERSION_MINOR) + && (cloog_version_revision () != CLOOG_VERSION_REVISION)) + { + return 1; + }])]) + +# CLOOG_CHECK_VERSION CLOOG_CHECK_VERSION (MAJOR, MINOR, REVISION) +# ---------------------------------------------------------------- +# Test the found CLooG to be exact of version MAJOR.MINOR and at least +# REVISION. +# If we're using the old CLooG-PPL (Legacy), the old version check will +# be executed (Ignores the provided version information). +AC_DEFUN([CLOOG_CHECK_VERSION], +[ + AC_REQUIRE([CLOOG_FIND_FLAGS]) + + if test "${ENABLE_CLOOG_CHECK}" = yes ; then + _cloog_saved_CFLAGS=$CFLAGS + _cloog_saved_LDFLAGS=$LDFLAGS + + CFLAGS="${_cloog_saved_CFLAGS} ${clooginc} ${pplinc} ${gmpinc}" + LDFLAGS="${_cloog_saved_LDFLAGS} ${clooglibs}" + + if test "${cloog_org}" = yes ; then + AC_CACHE_CHECK([for verison $1.$2.$3 of CLooG], + [gcc_cv_cloog_ct_0_14_0], + [AC_COMPILE_IFELSE([_CLOOG_CHECK_CT_PROG($1,$2,$3)], + [gcc_cv_cloog_ct_0_14_0=yes], + [gcc_cv_cloog_ct_0_14_0=no])]) + elif test "${cloog_org}" = no ; then + AC_CACHE_CHECK([for version 0.15.5 (or later revision) of CLooG], + [gcc_cv_cloog_ct_0_15_5], + [AC_COMPILE_IFELSE([_CLOOG_CHECK_CT_PROG(0,15,5)], + [AC_COMPILE_IFELSE([_CLOOG_CHECK_CT_PROG(0,15,9)], + [gcc_cv_cloog_ct_0_15_5=yes], + [gcc_cv_cloog_ct_0_15_5="buggy but acceptable"])], + [gcc_cv_cloog_ct_0_15_5=no])]) + fi + + CFLAGS=$_cloog_saved_CFLAGS + LDFLAGS=$_cloog_saved_LDFLAGS + fi +] +) + +# CLOOG_IF_FAILED (ACTION-IF-FAILED) +# ---------------------------------- +# Executes ACTION-IF-FAILED, if GRAPHITE was requested and +# the checks failed. +AC_DEFUN([CLOOG_IF_FAILED], +[ + CLOOG_REQUESTED([graphite_requested=yes], [graphite_requested=no]) + + if test "${gcc_cv_cloog_ct_0_14_0}" = no \ + || test "${gcc_cv_cloog_rt_0_14_0}" = no \ + || test "${gcc_cv_cloog_ct_0_15_5}" = no; then + clooglibs= + clooginc= + fi + + if test "${graphite_requested}" = yes \ + && test "x${clooglibs}" = x \ + && test "x${clooginc}" = x ; then + $1 + fi +] +) @@ -1451,7 +1451,8 @@ Optional Features: --enable-libssp build libssp directory --enable-build-with-cxx build with C++ compiler instead of C compiler --disable-ppl-version-check disable check for PPL version - --disable-cloog-version-check disable check for CLooG version + --disable-cloog-version-check + disable check for CLooG version --enable-lto enable link time optimization support --enable-stage1-languages[=all] choose additional languages to build during stage1. Mostly useful for compiler development. @@ -1502,11 +1503,14 @@ Optional Packages: plus --with-ppl-lib=PATH/lib --with-ppl-include=PATH Specify directory for installed PPL include files --with-ppl-lib=PATH Specify the directory for the installed PPL library - --with-cloog=PATH Specify prefix directory for the installed CLooG-PPL package - Equivalent to --with-cloog-include=PATH/include - plus --with-cloog-lib=PATH/lib - --with-cloog-include=PATH Specify directory for installed CLooG include files - --with-cloog-lib=PATH Specify the directory for the installed CLooG library + --with-cloog=PATH Specify prefix directory for the installed CLooG-PPL + package. Equivalent to + --with-cloog-include=PATH/include plus + --with-cloog-lib=PATH/lib + --with-cloog-include=PATH + Specify directory for installed CLooG include files + --with-cloog-lib=PATH Specify the directory for the installed CLooG + library --with-build-sysroot=SYSROOT use sysroot as the system root during the build --with-debug-prefix-map='A=B C=D ...' @@ -5651,8 +5655,7 @@ fi # Check for CLOOG -clooglibs=" -lcloog " -clooginc=" -DCLOOG_PPL_BACKEND " + # Check whether --with-cloog was given. @@ -5673,58 +5676,212 @@ if test "${with_cloog_lib+set}" = set; then : fi + # Check whether --enable-cloog-version-check was given. +if test "${enable_cloog_version_check+set}" = set; then : + enableval=$enable_cloog_version_check; ENABLE_CLOOG_CHECK=$enableval +else + ENABLE_CLOOG_CHECK=yes +fi + + + # Initialize clooglibs and clooginc. + case $with_cloog in + no) + clooglibs= + clooginc= + ;; + "" | yes) + ;; + *) + clooglibs="-L$with_cloog/lib" + clooginc="-I$with_cloog/include" + ;; + esac + if test "x${with_cloog_include}" != x ; then + clooginc="-I$with_cloog_include" + fi + if test "x${with_cloog_lib}" != x; then + clooglibs="-L$with_cloog_lib" + fi + + + + + if test "x$with_ppl" = "xno"; then with_cloog=no fi +if test "x${with_cloog}" = x && test "x${with_cloog_include}" = x \ + && test "x${with_cloog_lib}" = x && test -d ${srcdir}/cloog; then + clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' ' + clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include ' +fi +if test "x$with_cloog" != "xno"; then -case $with_cloog in - no) - clooglibs= - clooginc= - ;; - "" | yes) - ;; - *) - clooglibs="-L$with_cloog/lib -lcloog" - clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND " - ;; -esac -if test "x$with_cloog_include" != x; then - clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND " + + + _cloog_saved_CFLAGS=$CFLAGS + _cloog_saved_CPPFLAGS=$CPPFLAGS + _cloog_saved_LDFLAGS=$LDFLAGS + _cloog_saved_LIBS=$LIBS + + _clooglegacyinc="-DCLOOG_PPL_BACKEND" + _cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG" + + CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}" + CPPFLAGS="${CPPFLAGS} ${_clooglegacyinc} ${_cloogorginc}" + LDFLAGS="${LDFLAGS} ${clooglibs}" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG" >&5 +$as_echo_n "checking for installed CLooG... " >&6; } +if test "${gcc_cv_cloog_type+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + LIBS="-lcloog ${_cloog_saved_LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <cloog/cloog.h> +int +main () +{ +ppl_version_major () + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gcc_cv_cloog_type="PPL Legacy" +else + LIBS="-lcloog-isl -lisl ${_cloog_saved_LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <cloog/cloog.h> +int +main () +{ +cloog_version () + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gcc_cv_cloog_type=ISL +else + LIBS="-lcloog-ppl ${_cloog_saved_LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <cloog/cloog.h> +int +main () +{ +cloog_version () + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gcc_cv_cloog_type=PPL +else + gcc_cv_cloog_type=no fi -if test "x$with_cloog_lib" != x; then - clooglibs="-L$with_cloog_lib -lcloog" +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then - clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog ' - clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND ' - enable_cloog_version_check=no +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi - -# Check whether --enable-cloog-version-check was given. -if test "${enable_cloog_version_check+set}" = set; then : - enableval=$enable_cloog_version_check; ENABLE_CLOOG_CHECK=$enableval -else - ENABLE_CLOOG_CHECK=yes +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_type" >&5 +$as_echo "$gcc_cv_cloog_type" >&6; } + case $gcc_cv_cloog_type in + "PPL Legacy") + clooginc="${clooginc} ${_clooglegacyinc}" + clooglibs="${clooglibs} -lcloog" + cloog_org=no + ;; + "ISL") + clooginc="${clooginc} ${_cloogorginc}" + clooglibs="${clooglibs} -lcloog-isl" + cloog_org=yes + ;; + "PPL") + clooginc="${clooginc} ${_cloogorginc}" + clooglibs="${clooglibs} -lcloog-ppl" + cloog_org=yes + ;; + *) + clooglibs= + clooginc= + cloog_org= + ;; + esac -if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then - saved_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5 + LIBS=$_cloog_saved_LIBS + CFLAGS=$_cloog_saved_CFLAGS + CPPFLAGS=$_cloog_saved_CPPFLAGS + LDFLAGS=$_cloog_saved_LDFLAGS + + + + + + if test "${ENABLE_CLOOG_CHECK}" = yes ; then + _cloog_saved_CFLAGS=$CFLAGS + _cloog_saved_LDFLAGS=$LDFLAGS + + CFLAGS="${_cloog_saved_CFLAGS} ${clooginc} ${pplinc} ${gmpinc}" + LDFLAGS="${_cloog_saved_LDFLAGS} ${clooglibs}" + + if test "${cloog_org}" = yes ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for verison 0.14.0 of CLooG" >&5 +$as_echo_n "checking for verison 0.14.0 of CLooG... " >&6; } +if test "${gcc_cv_cloog_ct_0_14_0+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "cloog/cloog.h" +int +main () +{ +#if CLOOG_VERSION_MAJOR != 0 \ + || CLOOG_VERSION_MINOR != 14 \ + || CLOOG_VERSION_REVISION < 0 + choke me + #endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gcc_cv_cloog_ct_0_14_0=yes +else + gcc_cv_cloog_ct_0_14_0=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_ct_0_14_0" >&5 +$as_echo "$gcc_cv_cloog_ct_0_14_0" >&6; } + elif test "${cloog_org}" = no ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5 $as_echo_n "checking for version 0.15.5 (or later revision) of CLooG... " >&6; } +if test "${gcc_cv_cloog_ct_0_15_5+set}" = set; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "cloog/cloog.h" int main () { - - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5 - choke me - #endif - +#if CLOOG_VERSION_MAJOR != 0 \ + || CLOOG_VERSION_MINOR != 15 \ + || CLOOG_VERSION_REVISION < 5 + choke me + #endif ; return 0; } @@ -5736,35 +5893,67 @@ if ac_fn_c_try_compile "$LINENO"; then : int main () { - - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9 - choke me - #endif - +#if CLOOG_VERSION_MAJOR != 0 \ + || CLOOG_VERSION_MINOR != 15 \ + || CLOOG_VERSION_REVISION < 9 + choke me + #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + gcc_cv_cloog_ct_0_15_5=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy but acceptable" >&5 -$as_echo "buggy but acceptable" >&6; } + gcc_cv_cloog_ct_0_15_5="buggy but acceptable" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; }; clooglibs= ; clooginc= + gcc_cv_cloog_ct_0_15_5=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$saved_CFLAGS" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_ct_0_15_5" >&5 +$as_echo "$gcc_cv_cloog_ct_0_15_5" >&6; } + fi + + CFLAGS=$_cloog_saved_CFLAGS + LDFLAGS=$_cloog_saved_LDFLAGS + fi -# Flags needed for CLOOG + + + + if test "x${with_cloog}" != x \ + || test "x${with_cloog_include}" != x \ + || test "x${with_cloog_lib}" != x ; then + graphite_requested=yes + else + graphite_requested=no + fi + + + + if test "${gcc_cv_cloog_ct_0_14_0}" = no \ + || test "${gcc_cv_cloog_rt_0_14_0}" = no \ + || test "${gcc_cv_cloog_ct_0_15_5}" = no; then + clooglibs= + clooginc= + fi + + if test "${graphite_requested}" = yes \ + && test "x${clooglibs}" = x \ + && test "x${clooginc}" = x ; then + + as_fn_error "Unable to find a usable CLooG. See config.log for details." "$LINENO" 5 + fi + + +fi + # Check for LTO support. # Check whether --enable-lto was given. if test "${enable_lto+set}" = set; then : diff --git a/configure.ac b/configure.ac index 9b55f4e..50c9aee 100644 --- a/configure.ac +++ b/configure.ac @@ -28,6 +28,7 @@ m4_include([ltoptions.m4]) m4_include([ltsugar.m4]) m4_include([ltversion.m4]) m4_include([lt~obsolete.m4]) +m4_include([config/cloog.m4]) AC_INIT(move-if-change) AC_PREREQ(2.64) @@ -1587,68 +1588,38 @@ AC_SUBST(pplinc) # Check for CLOOG -clooglibs=" -lcloog " -clooginc=" -DCLOOG_PPL_BACKEND " - -AC_ARG_WITH(cloog, [ --with-cloog=PATH Specify prefix directory for the installed CLooG-PPL package - Equivalent to --with-cloog-include=PATH/include - plus --with-cloog-lib=PATH/lib]) -AC_ARG_WITH(cloog_include, [ --with-cloog-include=PATH Specify directory for installed CLooG include files]) -AC_ARG_WITH(cloog_lib, [ --with-cloog-lib=PATH Specify the directory for the installed CLooG library]) +dnl Provide configure switches and initialize clooginc & clooglibs +dnl with user input. +CLOOG_INIT_FLAGS if test "x$with_ppl" = "xno"; then with_cloog=no fi - -case $with_cloog in - no) - clooglibs= - clooginc= - ;; - "" | yes) - ;; - *) - clooglibs="-L$with_cloog/lib -lcloog" - clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND " - ;; -esac -if test "x$with_cloog_include" != x; then - clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND " +if test "x${with_cloog}" = x && test "x${with_cloog_include}" = x \ + && test "x${with_cloog_lib}" = x && test -d ${srcdir}/cloog; then + clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' ' + clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include ' fi -if test "x$with_cloog_lib" != x; then - clooglibs="-L$with_cloog_lib -lcloog" +if test "x$with_cloog" != "xno"; then + dnl Version check for CLooG-Org + dnl As long as there is no new release of CLooG, + dnl we will check for 0.14.0. + dnl + dnl The first git revision that will work with + dnl GCC is: bd91b845a65805c290d43fc1bef8139864a163fb + dnl This is enforced implictly, as this is the commit that + dnl introduced the versioning information used within our + dnl checks. + dnl + dnl If we're using CLooG-Legacy, the provided version information + dnl will be ignored. + CLOOG_CHECK_VERSION(0,14,0) + + dnl Only execute fail-action, if CLooG has been + dnl requested. + CLOOG_IF_FAILED([ + AC_MSG_ERROR([Unable to find a usable CLooG. See config.log for details.])]) fi -if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then - clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog ' - clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND ' - enable_cloog_version_check=no -fi - -AC_ARG_ENABLE(cloog-version-check, -[ --disable-cloog-version-check disable check for CLooG version], -ENABLE_CLOOG_CHECK=$enableval, -ENABLE_CLOOG_CHECK=yes) - -if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then - saved_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc" - AC_MSG_CHECKING([for version 0.15.5 (or later revision) of CLooG]) - AC_TRY_COMPILE([#include "cloog/cloog.h"],[ - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5 - choke me - #endif - ], [AC_TRY_COMPILE([#include "cloog/cloog.h"],[ - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9 - choke me - #endif - ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])], - [AC_MSG_RESULT([no]); clooglibs= ; clooginc= ]) - CFLAGS="$saved_CFLAGS" -fi - -# Flags needed for CLOOG -AC_SUBST(clooglibs) -AC_SUBST(clooginc) # Check for LTO support. AC_ARG_ENABLE(lto, |