From f16e223735a440c464486134dc0a1c7522abc0ef Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Fri, 12 Nov 2010 22:08:57 +0000 Subject: [PATCH] Add -enable-cloog-backend. * config/cloog.m4: Add -enable-cloog-backend=(isl|ppl|ppl-legacy) to define the cloog backend to use. Furthermore, only pass the ppllibs to the configure checks, if necessary. *configure: Regenerate. From-SVN: r166684 --- ChangeLog | 7 +++ config/cloog.m4 | 74 +++++++++++++++++++-------- configure | 133 +++++++++++++++++++++++++++++++++--------------- 3 files changed, 153 insertions(+), 61 deletions(-) diff --git a/ChangeLog b/ChangeLog index c03698373ef..9c8b3339f74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-11-12 Tobias Grosser + + * config/cloog.m4: Add -enable-cloog-backend=(isl|ppl|ppl-legacy) to + define the cloog backend to use. Furthermore, only pass the ppllibs to + the configure checks, if necessary. + * configure: Regenerate. + 2010-11-12 Tobias Grosser * config/cloog.m4: Use CLooG predefined macro to check for CLooG PPL. diff --git a/config/cloog.m4 b/config/cloog.m4 index 6ed0f1b55ec..4936e8a13c9 100644 --- a/config/cloog.m4 +++ b/config/cloog.m4 @@ -36,7 +36,19 @@ AC_DEFUN([CLOOG_INIT_FLAGS], [AS_HELP_STRING( [--with-cloog-lib=PATH], [Specify the directory for the installed CLooG library])]) - + + AC_ARG_ENABLE(cloog-backend, + [ --enable-cloog-backend[=backend] + isl: The cloog.org isl backend + ppl-legacy: The legacy ppl backend - default + ppl: The cloog.org ppl backend], + [ if test "x${enableval}" = "xisl"; then + cloog_backend=isl + elif test "x${enableval}" = "xppl"; then + cloog_backend=ppl + else + cloog_backend=ppl-legacy + fi], cloog_backend=ppl-legacy) AC_ARG_ENABLE(cloog-version-check, [AS_HELP_STRING( [--disable-cloog-version-check], @@ -87,11 +99,19 @@ AC_DEFUN([CLOOG_REQUESTED], ] ) -# _CLOOG_ORG_PROG () +# _CLOOG_ORG_PROG_ISL () # ------------------ -# Helper for detecting CLooG.org's backend. -m4_define([_CLOOG_ORG_PROG],[AC_LANG_PROGRAM( - [#include "cloog/cloog.h"], +# Helper for detecting CLooG.org's ISL backend. +m4_define([_CLOOG_ORG_PROG_ISL],[AC_LANG_PROGRAM( + [#include "cloog/cloog.h" ], + [cloog_version ()])]) + +# _CLOOG_ORG_PROG_PPL () +# ------------------ +# Helper for detecting CLooG.org's PPL backend. +m4_define([_CLOOG_ORG_PROG_PPL],[AC_LANG_PROGRAM( + [#include "cloog/cloog.h" + #include "cloog/ppl/cloog.h"], [cloog_version ()])]) # _CLOOG_PPL_LEGACY_PROG () @@ -106,7 +126,7 @@ m4_define([_CLOOG_PPL_LEGACY_PROG], [AC_LANG_PROGRAM( # CLOOG_FIND_FLAGS () # ------------------ # Detect the used CLooG-backend and set clooginc/clooglibs/cloog_org. -# Preference: CLooG-PPL (Legacy) > CLooG-ISL > CLooG-PPL +# Only look for the CLooG backend type specified in --enable-cloog-backend AC_DEFUN([CLOOG_FIND_FLAGS], [ AC_REQUIRE([CLOOG_INIT_FLAGS]) @@ -119,22 +139,36 @@ AC_DEFUN([CLOOG_FIND_FLAGS], _cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG" dnl clooglibs & clooginc may have been initialized by CLOOG_INIT_FLAGS. - CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}" + CFLAGS="${CFLAGS} ${clooginc} ${gmpinc}" CPPFLAGS="${CPPFLAGS} ${_cloogorginc}" - LDFLAGS="${LDFLAGS} ${clooglibs} ${ppllibs}" + 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 $cloog_backend in + "ppl-legacy") + CFLAGS="${CFLAGS} ${pplinc}" + LDFLAGS="${LDFLAGS} ${ppllibs}" + AC_CACHE_CHECK([for installed CLooG PPL Legacy], [gcc_cv_cloog_type], + [LIBS="-lcloog ${_cloog_saved_LIBS}" + AC_LINK_IFELSE([_CLOOG_PPL_LEGACY_PROG], [gcc_cv_cloog_type="PPL Legacy"], + [gcc_cv_cloog_type=no])]) + ;; + "isl") + AC_CACHE_CHECK([for installed CLooG ISL], [gcc_cv_cloog_type], + [LIBS="-lcloog-isl ${_cloog_saved_LIBS}" + AC_LINK_IFELSE([_CLOOG_ORG_PROG_ISL], [gcc_cv_cloog_type="ISL"], + [gcc_cv_cloog_type=no])]) + ;; + "ppl") + CFLAGS="${CFLAGS} ${pplinc}" + LDFLAGS="${LDFLAGS} ${ppllibs}" + AC_CACHE_CHECK([for installed CLooG PPL], [gcc_cv_cloog_type], + [LIBS="-lcloog-ppl ${_cloog_saved_LIBS}" + AC_LINK_IFELSE([_CLOOG_ORG_PROG_PPL], [gcc_cv_cloog_type="PPL"], + [gcc_cv_cloog_type=no])]) + ;; + *) + gcc_cv_cloog_type="" + esac case $gcc_cv_cloog_type in "PPL Legacy") diff --git a/configure b/configure index 0e4f1ed5baa..bcc087bb242 100755 --- a/configure +++ b/configure @@ -765,6 +765,7 @@ enable_ppl_version_check with_cloog with_cloog_include with_cloog_lib +enable_cloog_backend enable_cloog_version_check enable_lto enable_stage1_languages @@ -1451,6 +1452,10 @@ 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 + --enable-cloog-backend=backend + isl: The cloog.org isl backend + ppl-legacy: The legacy ppl backend - default + ppl: The cloog.org ppl backend --disable-cloog-version-check disable check for CLooG version --enable-lto enable link time optimization support @@ -5676,6 +5681,19 @@ if test "${with_cloog_lib+set}" = set; then : fi + # Check whether --enable-cloog-backend was given. +if test "${enable_cloog_backend+set}" = set; then : + enableval=$enable_cloog_backend; if test "x${enableval}" = "xisl"; then + cloog_backend=isl + elif test "x${enableval}" = "xppl"; then + cloog_backend=ppl + else + cloog_backend=ppl-legacy + fi +else + cloog_backend=ppl-legacy +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 @@ -5727,17 +5745,21 @@ if test "x$with_cloog" != "xno"; then _cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG" - CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}" + CFLAGS="${CFLAGS} ${clooginc} ${gmpinc}" CPPFLAGS="${CPPFLAGS} ${_cloogorginc}" - LDFLAGS="${LDFLAGS} ${clooglibs} ${ppllibs}" + LDFLAGS="${LDFLAGS} ${clooglibs}" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG" >&5 -$as_echo_n "checking for installed CLooG... " >&6; } + case $cloog_backend in + "ppl-legacy") + CFLAGS="${CFLAGS} ${pplinc}" + LDFLAGS="${LDFLAGS} ${ppllibs}" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG PPL Legacy" >&5 +$as_echo_n "checking for installed CLooG PPL Legacy... " >&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 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "cloog/cloog.h" int @@ -5752,50 +5774,79 @@ main () _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 rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -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; } + ;; + "isl") + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG ISL" >&5 +$as_echo_n "checking for installed CLooG ISL... " >&6; } +if test "${gcc_cv_cloog_type+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + LIBS="-lcloog-isl ${_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 + gcc_cv_cloog_type=no +fi +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; } + ;; + "ppl") + CFLAGS="${CFLAGS} ${pplinc}" + LDFLAGS="${LDFLAGS} ${ppllibs}" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG PPL" >&5 +$as_echo_n "checking for installed CLooG PPL... " >&6; } +if test "${gcc_cv_cloog_type+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + LIBS="-lcloog-ppl ${_cloog_saved_LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "cloog/cloog.h" + #include "cloog/ppl/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 +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; } + ;; + *) + gcc_cv_cloog_type="" + esac case $gcc_cv_cloog_type in "PPL Legacy")